Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
XueliangHan committed Mar 9, 2013
1 parent 5419cc5 commit d7e9316
Show file tree
Hide file tree
Showing 15 changed files with 171 additions and 67 deletions.
1 change: 1 addition & 0 deletions CNAME
@@ -0,0 +1 @@
www.thinkingnotes.net
15 changes: 0 additions & 15 deletions HTML.markdown

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
publishing
==========

Hi! This is my personal publishing platform
Hi! This is my personal publishing platform
3 changes: 3 additions & 0 deletions copy.sh
@@ -0,0 +1,3 @@
#!/bin/bash

cp ~/Documents/*.markdown ./jekyll/_posts
File renamed without changes.
47 changes: 47 additions & 0 deletions 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

48 changes: 48 additions & 0 deletions 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)

19 changes: 19 additions & 0 deletions 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:
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
22 changes: 22 additions & 0 deletions 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.
7 changes: 7 additions & 0 deletions 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)
15 changes: 0 additions & 15 deletions jekyll/_post/HTML.markdown

This file was deleted.

18 changes: 0 additions & 18 deletions jekyll/_post/project_static-github-website.markdown

This file was deleted.

1 change: 1 addition & 0 deletions jekyll/_site/CNAME
@@ -0,0 +1 @@
www.thinkingnotes.net
22 changes: 22 additions & 0 deletions 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
18 changes: 0 additions & 18 deletions project_static-github-website.markdown

This file was deleted.

0 comments on commit d7e9316

Please sign in to comment.