Skip to content

Instantly share code, notes, and snippets.

View yangg's full-sized avatar

Brook yangg

  • ShenZhen, China
View GitHub Profile
@yangg
yangg / dabblet.css
Created March 22, 2012 16:07
multi-column layouts - Learning Css3
/**
* multi-column layouts - Learning Css3
* http://www.w3.org/TR/css3-multicol/
*/
body { font: 14px/1.5 "Lucida Grande", "Lucida Sans Unicode", Lucida, Arial, Helvetica, sans-serif; }
/*
* columns: column-count columns-width
* column-gap: 1em(default)
* column-rule
@yangg
yangg / dabblet.css
Created March 24, 2012 08:25
Pseudo-classes and HTML5 Forms - Learning CSS3
/**
* Pseudo-classes and HTML5 Forms - Learning CSS3
* http://html5doctor.com/css3-pseudo-classes-and-html5-forms/
*/
body { font: 14px/1.5 Verdana,Microsoft YaHei,Ubuntu; }
textarea, input[type=text], input[type=email], input[type=number] { font-size: 13px; border: solid 1px #ABADB3; border-radius: 2px; }
input[type=number] { width: 40px; }
textarea { line-height: 1.3; pading: 5px; }
input { margin: 0 5px; }
@yangg
yangg / dev.conf
Created March 26, 2012 05:29
Nginx Configs
server {
root /home/brook/Public/$host;
location / {
# default_server
if (!-d /home/brook/Public/$host) {
proxy_pass http://localhost;
break;
}
@yangg
yangg / dabblet.css
Created March 26, 2012 07:06
Css icons
/**
* Css icons
*/
body { font: 14px/1.5 "Lucida Grande", "Lucida Sans Unicode", Lucida, Arial, Helvetica, sans-serif; }
a {color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }
.prev-entry:before, .next-entry:after { border: solid 4px transparent; border-width: 5px 4px; content: ""; width: 0; height: 0; display: inline-block; }
.prev-entry:before { border-right-color: #999; margin-right: 3px; }
.next-entry:after { border-left-color: #999; margin-left: 3px; }
@yangg
yangg / functions.vim
Created March 29, 2012 09:29
Vim Scripts
" auto reload nginx & apache
function! Reload()
let output = system(&ft == 'nginx' ? 'service nginx configtest && service nginx reload' : 'service apache2 reload')
if v:shell_error
echohl WarningMsg | echo output
endif
endfunction
autocmd! BufWritePost */nginx*conf,*/apache*conf call Reload()
@yangg
yangg / README.mkd
Created March 29, 2012 09:53
Emacs Scripts
@yangg
yangg / crc32.js
Created March 29, 2012 09:55
Javascript Functions
/*
===============================================================================
Crc32 is a JavaScript function for computing the CRC32 of a string
...............................................................................
Version: 1.2 - 2006/11 - http://noteslog.com/category/javascript/
-------------------------------------------------------------------------------
Copyright (c) 2006 Andrea Ercolino
http://www.opensource.org/licenses/mit-license.php
@yangg
yangg / reverse-proxy.conf
Created April 7, 2012 16:26
Apache Configs
# http://httpd.apache.org/docs/current/mod/core.html
# http://httpd.apache.org/docs/current/mod/mod_proxy.html
# enable proxy modules
# sudo ln -s /etc/apache2/mods-available/proxy.load /etc/apache2/mods-enabled
# sudo ln -s /etc/apache2/mods-available/proxy_http.load /etc/apache2/mods-enabled
# sudo service apache2 force-reload
# or
# LoadModule proxy_module modules/mod_proxy.so
# LoadModule proxy_http_module modules/mod_proxy_http.so