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 gen_uuid() { | |
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', | |
// 32 bits for "time_low" | |
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), | |
// 16 bits for "time_mid" | |
mt_rand( 0, 0xffff ), | |
// 16 bits for "time_hi_and_version", | |
// four most significant bits holds version number 4 |
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
<?php | |
// Create connection | |
$con=mysqli_connect("localhost","root","Kit to 0","sunshine"); | |
// Check connection | |
if (mysqli_connect_errno()) { | |
echo "Failed to connect to MySQL: " . mysqli_connect_error(); | |
} else { | |
$sql = "SELECT date, sum(total) AS spend | |
FROM comsumption |
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
/******************************************************************* | |
* author: ryan Yang | |
* date: 2012.10.5 | |
********************************************************************/ | |
/*================================================================= | |
Android | |
===============================================================*/ |
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
apache:{ | |
1. syntax test: sudo apachectl configtest / sudo apachectl -t | |
2. restart: sudo apachectl restart | |
3. dis/enable site sudo a2[dis | en] site [SITENAME] | |
4. httpd.conf: ServerName 127.0.1.1 | |
5. hosts: 127.0.0.1 PC_NAME | |
6. dropbox: ./dropbox-list/dropbox | |
7. cfusion10: /opt/coldfusion10/cfusion/bin/coldfusion start | |
8. unzip tar.bz2: tar -jxvf FileName.tar.bz2 | |
9. unzip .tar.gz: tar -zxvf FileName.tat.gz |
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
Commands: | |
1. pwd: print working directory | |
2. ls: list [ -s | -sh | -h] | |
3. cd { | |
root: cd / | |
home: cd or cd ~ | |
up: cd.. | |
back: cd - | |
} | |
4. cp: copy [-r] |
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
restart: { | |
cfusion8: sudo /etc/init.d/cfmx8-cfusion start | |
cfusion10:{ | |
win: coldfusion.exe restart -console | |
linux: sudo /opt/coldfusion10/cfusion/bin/coldfusion restart | |
} | |
} | |
install: { |
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
regex{ | |
negated character class:{ | |
[^...] | |
} | |
word bundary:{ | |
\b | |
\< | |
\> | |
} | |
wrod: { |
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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
ignorecase = true | |
precomposeunicode = false | |
[color] | |
ui = auto | |
[color "branch"] |
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
# get svn user list | |
svn log -q svn_repository | grep -e '^r' | awk 'BEGIN {FS = "|" }; {print $2}' | sort | uniq | |
svn log --xml svn_repository | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /' | |
# create file users.txt: | |
old_username = new_usename <user_email> | |
# svn to git | |
git svn clone svn_repository --authors-file=users.txt --no-metadata -s git_fold | |
# specify reversion |
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
# store credentials | |
#keep your password cached in memory for (by default) 15 minutes. | |
git config --global credential.helper cache | |
# set a longer timeout | |
git config --global credential.helper "cache --timeout=3600" | |
#another way | |
git config remote.origin.url https://you:[email protected]/you/example.git |