Skip to content

Instantly share code, notes, and snippets.

View yangg's full-sized avatar

Brook yangg

  • ShenZhen, China
View GitHub Profile
@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 / README.mkd
Created March 29, 2012 09:53
Emacs Scripts
@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 / 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 / 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 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 / 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 22, 2012 10:29
text-shadow, text-stroke - Learning Css3
/**
* text-shadow, text-stroke - Learning Css3
*/
div { border: solid 1px #ccc; margin: 10px; padding: 0 10px;
font: 2em/1.8 Verdana,Microsoft YaHei,Ubuntu; }
/**
* text-shadow: h-shadow v-shadow blur color;
*/
.text-shadow { text-shadow: 2px 2px #666; font-size: 1.5em; }
@yangg
yangg / dabblet.css
Created March 22, 2012 08:31
box-shadow, resize - Learning Css3
/**
* box-shadow, resize - Learning Css3
*/
div { width: 100px; height: 100px; border: solid 1px #ccc;
margin: 20px; float: left; }
/* box-shadow: h-shadow v-shadow blur spread color inset; */
.shadow1 { box-shadow: 5px 5px 8px #f06; }
.shadow-inner { box-shadow: 0 0 10px #f06 inset; }
.shadow-oneside { box-shadow: 5px 0 5px -5px #f06; }
@yangg
yangg / dabblet.css
Created March 22, 2012 06:00
Checkable star
/**
* Checkable star
*/
.checkable-star { display: none; }
.checkable-star + label { padding: 1px 8px; cursor: pointer; background: url(http://uedsky.com/images/res/star-icons.png) no-repeat; }
.checkable-star + label:hover { background-position: -16px 0; }
.checkable-star:checked + label { background-position: -32px 0; }