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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="jquery-1.9.0.js" ></script> | |
<script src="handlebars-1.0.rc.2.js" ></script> | |
<script src="underscore-1.4.4.js" ></script> | |
<script src="backbone-0.9.10.js" ></script> |
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
- Create a repository | |
git init <repo-name> | |
git clone <url> <directory-name> | |
git clone -o <remote-name> <url> | |
- Commiting | |
git add <filename> | |
git commit -m "Commit Message" | |
git commit -am "Commit Message" | |
git commit --amend --date="now" |
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
/** | |
* if v2 version value bigger than v1, returns true. otherwise returns false. | |
* | |
* Version part lengths should be equal. | |
* | |
* Examples: | |
* isVersionNewer('1', '2'); -> true | |
* isVersionNewer('1.0', '2.0'); -> true | |
* isVersionNewer('2.0.1', '2.0.0'); -> false | |
* isVersionNewer('3.2.1.0', '3.2.1.1'); -> true |
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
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => { | |
return [1, 2, 3]; |
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
# Create your superuser | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
# Alias for convenience (optional and at your own risk) | |
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
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
// Invoked once before first render | |
componentWillMount() { | |
console.log('componentWillMount'); | |
// Calling setState here does not cause a re-render | |
} | |
// Invoked once after the first render | |
componentDidMount(){ | |
console.log('componentDidMount'); | |
} |
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
for file in ADA202_*.pdf | |
do | |
mv "$file" "${file/ADA202_/}" | |
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
# This will; | |
# - stop every container | |
# - remove every container | |
# - remove every image | |
# - remove every network | |
# - remove every volume | |
$(docker stop -f $(docker ps -aq)) / | |
$(docker rm -f $(docker ps -aq)) / | |
$(docker rmi -f $(docker images -aq)) / |
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
# Simply Add this into your .bashrc or .zshrc or something. | |
# Reload bash and then; | |
# kilp 7070 | |
function kilp() { | |
kill -9 $(lsof -ti tcp:$1) | |
} |
OlderNewer