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
#!/usr/bin/ruby | |
# | |
# This script assumes that you have either 0 or 1 pgbackups stored | |
# on Heroku, and that you already have the heroku gem installed | |
# and configured on your system. | |
# | |
PROJECT_DIRECTORY = "/home/jwood/dev/myproj" | |
BACKUP_FILE = "/home/jwood/backup/myproj.dump" |
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
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.gz | |
tar xzf ruby-1.9.2-p180.tar.gz | |
cd ruby-1.9.2-p180 | |
./configure | |
make | |
make install | |
make install-doc | |
gem update --system |
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
cd ~/.pow | |
ln -s /path/to.app default |
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
ssh tmux@host -L 3000:localhost: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
Testable Abstractions in Rails | |
============================= | |
In Java or C#, it is common to build abstractions around external | |
dependencies like Logging or Caching libraries. | |
The advantages of such abstractions are twofold: | |
1) They can allow the caller to hide the methods/usage patterns that aren't | |
relevant to their application. |
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
class Solution { | |
public int equi ( int[] A ) { | |
int result = -1; | |
for(int i = 0; i < A.length; i++) { | |
if (lowerBound(A,i) == upperBound(A,i)) { | |
result = i; | |
break; | |
} | |
} | |