From d7e9316d149ac7d26b603751dd52b7fa4c4d3f85 Mon Sep 17 00:00:00 2001 From: "Xueliang (Albert) Han" Date: Sat, 9 Mar 2013 23:04:57 +0800 Subject: [PATCH] Update --- CNAME | 1 + HTML.markdown | 15 ------ README.md | 2 +- copy.sh | 3 ++ jekyll/favicon.ico => favicon.ico | Bin jekyll/_post/2013-03-05-python.markdown | 47 +++++++++++++++++ ...-06-project_static-github-website.markdown | 48 ++++++++++++++++++ jekyll/_post/2013-03-07-HTML.markdown | 19 +++++++ ...3-08-InterviewQuestion-Networking.markdown | 22 ++++++++ jekyll/_post/2013-03-09-git.markdown | 7 +++ jekyll/_post/HTML.markdown | 15 ------ .../project_static-github-website.markdown | 18 ------- jekyll/_site/CNAME | 1 + newpost.sh | 22 ++++++++ project_static-github-website.markdown | 18 ------- 15 files changed, 171 insertions(+), 67 deletions(-) create mode 100644 CNAME delete mode 100644 HTML.markdown create mode 100755 copy.sh rename jekyll/favicon.ico => favicon.ico (100%) create mode 100644 jekyll/_post/2013-03-05-python.markdown create mode 100644 jekyll/_post/2013-03-06-project_static-github-website.markdown create mode 100644 jekyll/_post/2013-03-07-HTML.markdown create mode 100644 jekyll/_post/2013-03-08-InterviewQuestion-Networking.markdown create mode 100644 jekyll/_post/2013-03-09-git.markdown delete mode 100644 jekyll/_post/HTML.markdown delete mode 100644 jekyll/_post/project_static-github-website.markdown create mode 100644 jekyll/_site/CNAME create mode 100644 newpost.sh delete mode 100644 project_static-github-website.markdown diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..95a909a --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +www.thinkingnotes.net diff --git a/HTML.markdown b/HTML.markdown deleted file mode 100644 index bea91a5..0000000 --- a/HTML.markdown +++ /dev/null @@ -1,15 +0,0 @@ - -li: List -ul: Unordered List -ol: One Ordered List -Example: - -
    -
  1. Coffee
  2. -
  3. Tea
  4. -
  5. Milk
  6. -
diff --git a/README.md b/README.md index 3083245..c42d3bc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ publishing ========== -Hi! This is my personal publishing platform \ No newline at end of file +Hi! This is my personal publishing platform diff --git a/copy.sh b/copy.sh new file mode 100755 index 0000000..009b975 --- /dev/null +++ b/copy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cp ~/Documents/*.markdown ./jekyll/_posts diff --git a/jekyll/favicon.ico b/favicon.ico similarity index 100% rename from jekyll/favicon.ico rename to favicon.ico diff --git a/jekyll/_post/2013-03-05-python.markdown b/jekyll/_post/2013-03-05-python.markdown new file mode 100644 index 0000000..c36598f --- /dev/null +++ b/jekyll/_post/2013-03-05-python.markdown @@ -0,0 +1,47 @@ +Python Learning & Practicing & Practicing Notes +=============================================== + +##Design technology +------------------- +Mix-in:A program design technology used in python program, as a base class or method of a class, can be dynamic changed during the runing time, so presentation of a class can be changed. Mix-in can be used in a general interface. + + +Library +------- + webbrowser(webrowser.open_new("url"), webbrowser.open_new_tab("url")) + + +XML +--- +###library +sax + +Directory support +module + os.path + os.path.isdir # check the directory exist? + os.path.join # use correct sepreator(*) connect paths into one (Used in UNIX) + os.makedirs +dir name is refered by a varible `directory`, + +###Code +####Header + from xml.sax.handler import ContentHandler + from xml.sax import parse +####IO.Write(Printf in C programming language) + self.out.write(' %s="%s"' % (key, val)) + printf(" %s=%s" , str1, str2); +####Quote + in python: ":" + in c : "{ }" + +Language symbol +Operator: +Equal, like `if name == 'page': ' +###Object.attrs +attrs.items, attrs[''] + + +Bug: +Type error: coercing to Unicode need string or buffer, instance found + diff --git a/jekyll/_post/2013-03-06-project_static-github-website.markdown b/jekyll/_post/2013-03-06-project_static-github-website.markdown new file mode 100644 index 0000000..09e5dce --- /dev/null +++ b/jekyll/_post/2013-03-06-project_static-github-website.markdown @@ -0,0 +1,48 @@ +Hacker's way to publishing(blogging) +==================================== + +Project description +------------------- +Use markup language (Markdown/Textile) to writing, write code and use jekyll(Ruby) to generate static webpage, use git to keep data sync, use github as web host. + + + +Purpose - The way I want +------------------------- +_Enjoyable writing_: With the help of Markdown and Textile, the writing/editing progress has become very enjoyable, I can fully focus on writing, if I want mark text with formatted form, I don't need to move my hand off the keyboard to find the mouse, I just mark it with text (Markdown or Textile). +_Simple publishing_: With the help of Jekyll, Git, and Github, the publishing procedure is extremly simple, I just need excute one commond, the new article will be generated into HTML and upload to my remote server, then you can see it on the website. +_Offline editing & Auto syncing_: I can modify any article I wrote before whether there is Internet access or not, because all data is on my local computer, and after edit, all changes I had made is sync to my website on remote server. (Details: I modified many articles which data stored in files and markup by Markdown or Textile, after the command excuted, all HTML files will be regenerated, the time is very fast, then the new HTML files will be sync to remote server, so the website is the latest version.) +_Backup_: Meantime, due to the fact of data is both on local computer and remote server, and synced via git, a backup function is archived accidently, I can backup my local data info external drive, and I can backup my remote server data into other cloud service. +_Data Free_: All the data and information which is produced by you is in your hand, you can do what ever you want to. + +Design +------ +###Website Architecture +|--config.yml +|--CNAME +|-- includes +|-- layouts +|-- posts +|-- static +|-- site +|--about.html +|--index.html +|--search.html +|--resume.html + +###Data storage and sitemap +Post named like DATE-NAME, and ordered by date, example: 2013-03-07-Hacker's-way-of-publishing. +Index is automatically orgranized by Jekyll. +Site mind map is the job which need manually done by myself, details about design and implement: + + +Implement +--------- +Install ruby, RubyGems [Jekyll install at Github](https://github.com/mojombo/jekyll/wiki/install) + + + +Reference +---------- +* [RubyGems - Wikipedia](http://en.wikipedia.org/wiki/RubyGems) + diff --git a/jekyll/_post/2013-03-07-HTML.markdown b/jekyll/_post/2013-03-07-HTML.markdown new file mode 100644 index 0000000..e73b93e --- /dev/null +++ b/jekyll/_post/2013-03-07-HTML.markdown @@ -0,0 +1,19 @@ +HTML(Hyper Text Markup Language) +================================ + +TAG +---- +##li: List +##ul: Unordered List +##ol: One Ordered List +##Example: + +
    +
  1. Coffee
  2. +
  3. Tea
  4. +
  5. Milk
  6. +
diff --git a/jekyll/_post/2013-03-08-InterviewQuestion-Networking.markdown b/jekyll/_post/2013-03-08-InterviewQuestion-Networking.markdown new file mode 100644 index 0000000..0cccde7 --- /dev/null +++ b/jekyll/_post/2013-03-08-InterviewQuestion-Networking.markdown @@ -0,0 +1,22 @@ +Networking +========== + +Interview Questions +------------------- + +###1.Explain what happens, step by step, after you type a RUL into a browser. Use as much tetails as possible. +####DNS stage +* Browser retrieval the IP address of URL in local hosts file. +* If browser not find IP address of URL in local hosts file, browser will contacts the remote DNS server to find the IP address of URL. +* DNS returns back the IP address of the site. +* (Note: DNS (Domain Name Resolution), the wab and address we type are nothing but an alias to an IP address in human readable form. There is an association called ICANN (Internet Corporation for Assigned names and Numbers) charge all of the centralized registration tasks including IP address assignment, DNS domain name assignment, and protocol parameters management. DNS is a distributed but hierarchical entity, which each domain name server is divided into zones, like some server charge for .com domain, some manage .net domain, but DNS servers can work together to map all domain names to their IP addresses.) +####Fetching stage - Get all data back +* Browser opens TCP connection to the web server at port 80. +* Browser fetches the html code of the page requested. (More details: Browser fetches all the files of the page requested, suck as: HTML code, CSS code, Javascript code, maybe these files are in different server, but the browser will need them all and will get them all.) +####Processing stage +* Browser renders the HTML in the display window. +####Terminating stage +* Browser terminates the connection when window closed. + + +###2. diff --git a/jekyll/_post/2013-03-09-git.markdown b/jekyll/_post/2013-03-09-git.markdown new file mode 100644 index 0000000..2fb9e65 --- /dev/null +++ b/jekyll/_post/2013-03-09-git.markdown @@ -0,0 +1,7 @@ + + + + +Reference +--------- +* [Everyday GIT with 20 Command or So](https://www.kernel.org/pub/software/scm/git/docs/everyday.html) diff --git a/jekyll/_post/HTML.markdown b/jekyll/_post/HTML.markdown deleted file mode 100644 index bea91a5..0000000 --- a/jekyll/_post/HTML.markdown +++ /dev/null @@ -1,15 +0,0 @@ - -li: List -ul: Unordered List -ol: One Ordered List -Example: - -
    -
  1. Coffee
  2. -
  3. Tea
  4. -
  5. Milk
  6. -
diff --git a/jekyll/_post/project_static-github-website.markdown b/jekyll/_post/project_static-github-website.markdown deleted file mode 100644 index 0ec2979..0000000 --- a/jekyll/_post/project_static-github-website.markdown +++ /dev/null @@ -1,18 +0,0 @@ - -Install ruby, RubyGems -[Jekyll install at Github](https://github.com/mojombo/jekyll/wiki/install) - - - -Architecture: ------------- -Post named like DATE-NAME, and ordered by date, example: 2013-03-07-Hacker's-way-of-publishing. -Index is automatically orgranized by Jekyll. -Site mind map is the job which need manually done by myself, details about design and implement: - - - -Reference: ----------- -* [RubyGems - Wikipedia](http://en.wikipedia.org/wiki/RubyGems) - diff --git a/jekyll/_site/CNAME b/jekyll/_site/CNAME new file mode 100644 index 0000000..95a909a --- /dev/null +++ b/jekyll/_site/CNAME @@ -0,0 +1 @@ +www.thinkingnotes.net diff --git a/newpost.sh b/newpost.sh new file mode 100644 index 0000000..49583de --- /dev/null +++ b/newpost.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ $# -lt 1 ] +then + echo "New post: You need to give a post name." + exit 1 +fi + +POST_NAME=$1 +POST_DATE=`date +%y-%m-%d` +POST_DIR="./jekyll/_posts" +FILE_NAME=`echo "$POST_DIR/$POST_DATE-$POST_NAME.markdown" | sed "s/ /-/g"` + +echo " +--- +layout: post +title: $POST_NAME +tag: [] +--- +" > $FILE_NAME + +vim -c "set spell" $FILE_NAME diff --git a/project_static-github-website.markdown b/project_static-github-website.markdown deleted file mode 100644 index 0ec2979..0000000 --- a/project_static-github-website.markdown +++ /dev/null @@ -1,18 +0,0 @@ - -Install ruby, RubyGems -[Jekyll install at Github](https://github.com/mojombo/jekyll/wiki/install) - - - -Architecture: ------------- -Post named like DATE-NAME, and ordered by date, example: 2013-03-07-Hacker's-way-of-publishing. -Index is automatically orgranized by Jekyll. -Site mind map is the job which need manually done by myself, details about design and implement: - - - -Reference: ----------- -* [RubyGems - Wikipedia](http://en.wikipedia.org/wiki/RubyGems) -