- 要实现的目标和要解决的问题;
- 要达到的结果,宽松和严格时间节点?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compass compile --force | |
sed -i -e "s/^@charset.*$//g" public/stylesheets/*.css | |
jammit --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# PHP CodeSniffer pre-commit hook for git | |
# | |
# @author Soenke Ruempler <soenke@ruempler.eu> | |
# @author Sebastian Kaspari <s.kaspari@googlemail.com> | |
# | |
# see the README | |
PHPCS_BIN=/usr/bin/phpcs | |
PHPCS_CODING_STANDARD=PEAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Searches Dash for the word under your cursor in vim, using the keyword | |
" operator, based on file type. E.g. for JavaScript files, I have it | |
" configured to search j:term, which immediately brings up the JS doc | |
" for that keyword. Might need some customisation for your own keywords! | |
function! SearchDash() | |
" Some setup | |
let s:browser = "/usr/bin/open" | |
let s:wordUnderCursor = expand("<cword>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Search Dash for word under cursor | |
function! SearchDash() | |
let s:browser = "/usr/bin/open" | |
let s:wordUnderCursor = expand("<cword>") | |
let s:url = "dash://".s:wordUnderCursor | |
let s:cmd ="silent ! " . s:browser . " " . s:url | |
execute s:cmd | |
redraw! | |
endfunction | |
map <leader>d :call SearchDash()<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PrimeGenerator = function() { | |
// 初始化的素数 | |
this.prime = 1; | |
// 判断是否是素数 | |
this.isPrime = function(num) { | |
var result = true; | |
if (num !== 2) { | |
if (num % 2 == 0) { | |
result = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function minimum(a,b,c) { | |
var min = a; | |
if (b<min) { | |
min = b; | |
} | |
if (c<min) { | |
min = c; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# build trust relations between linux hosts | |
user="wangshijun" | |
machine="hostname1 hostname2 hostname3" | |
for i in $machine | |
do | |
scp ~/.ssh/id_rsa.pub ${user}@$i:./ | |
ssh ${user}@$i 'cat id_rsa.pub >>.ssh/authorized_keys; chmod 700 .ssh;chmod 600 .ssh/authorized_keys' | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TMP_DIR="output" | |
PRODUCT_DIR="project-production" | |
IGNORE_FILE="$TMP_DIR build.sh tests" | |
OUTPUT_FILE="project-production.tar.gz" | |
# prepare tmp dir | |
mkdir -p $TMP_DIR | |
rm -rf $TMP_DIR/* |