This file contains hidden or 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
Display what branch i'm on: | |
~/.bash_profile or .bashrc | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] ' | |
~/.gitconfig | |
[alias] | |
ci = commit | |
br = branch |
This file contains hidden or 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
sorted = window.items.sort((a,b) -> a.track_id - b.track_id) | |
results = [] | |
for item,i in sorted | |
if i < sorted.length - 1 && sorted[ i + 1 ].element_id == sorted[i].element_id | |
results.push sorted[i] | |
results |
This file contains hidden or 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
# http://stackoverflow.com/questions/2314643/how-can-i-get-find-to-ignore-svn-directories | |
find . -path '*/.svn' -prune -o -type f -print0 | xargs -0 grep 'subscribe' | |
find . | grep -v \.svn | |
# or maybe | |
ack |
This file contains hidden or 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
or any partition | |
https://help.ubuntu.com/community/RenameUSBDrive |
This file contains hidden or 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
#https://github.com/javan/whenever/ | |
##### Check if a process is running or not | |
#!/bin/bash | |
#http://stackoverflow.com/questions/9336596/rvm-installation-not-working-rvm-is-not-a-function | |
source ~/.rvm/scripts/rvm | |
# http://cazatech.wordpress.com/2007/07/07/shell-script-restart-process-if-not-found-running/ |
This file contains hidden or 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
http://linuxcommand.org/wss0150.php | |
http://www.freeos.com/guides/lsst/ | |
http://linuxcommand.org/man_pages/bash1.html |
This file contains hidden or 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
http://getfirebug.com/wiki/index.php/Firebug_Extensions#Firepicker | |
http://jsbeautifier.org/?without-codemirror |
This file contains hidden or 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
http://www.alexonlinux.com/signal-handling-in-linux |
This file contains hidden or 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
# http://stackoverflow.com/questions/267237/whats-the-best-way-to-unit-test-protected-private-methods-in-ruby | |
class Class | |
def publicize_methods | |
saved_private_instance_methods = self.private_instance_methods | |
self.class_eval { public *saved_private_instance_methods } | |
begin | |
yield | |
ensure | |
self.class_eval { private *saved_private_instance_methods } | |
end |
This file contains hidden or 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
#http://blog.softlayer.com/2011/mysql-slow-check-for-fragmentation/ | |
#!/bin/bash | |
MYSQL_LOGIN='-u root --password=password' | |
for db in $(echo "SHOW DATABASES;" | mysql | grep -v -e "Database" -e "information_schema" -e "mysql" -e "performance_schema" -e "^test") | |
#for db in $(echo "SHOW DATABASES;" | mysql $MYSQL_LOGIN | grep -v -e "Database" -e "information_schema") | |
do | |
TABLES=$(echo "USE $db; SHOW TABLES;" | mysql $MYSQL_LOGIN | grep -v Tables_in_) |