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
% rvm pkg install zlib | |
% rvm install 1.9.3 --with-zlib-dir=~/.rvm/usr | |
% rvm use 1.9.3 | |
% gem install rake | |
ERROR: Loading command: install (LoadError) | |
cannot load such file -- zlib | |
ERROR: While executing gem ... (NameError) | |
uninitialized constant Gem::Commands::InstallCommandERROR: Loading command: install (LoadError) | |
cannot load such file -- zlib | |
ERROR: While executing gem ... (NameError) |
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
def neighbors(cell) | |
neighbors = [] | |
x = cell[0] | |
y = cell[1] | |
(x-1..x+1).each do |xx| | |
(y-1..y+1).each do |yy| | |
next if xx==x && yy==y | |
neighbors.push([xx,yy]) | |
end | |
end |
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
a='o'*12 | |
a[gets.to_i%12]=?h | |
a[m=$_[3,2].to_i/5]=a[m]<?o??x:?m | |
b=Array.new(11){" "*17} | |
12.times{|i|t=i*0.523-1.57;b[(5+4.9*Math.sin(t)).round][(8+8*Math.cos(t)).round]=a[i]} | |
b.map{|l|puts l.rstrip} |
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/perl | |
use File::Find; | |
my $backup_root = "/path/to/folder" | |
# purge backups older than AGE in days | |
my @file_list; | |
my @find_dirs = ($backup_root); # directories to search | |
my $now = time(); # get current time | |
my $days = 30; # how many days old |
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 ( !$.browser.mozilla ) | |
{ | |
// Bind 'scroll' for most browsers | |
} else { | |
// Bind 'scroll' for Mozilla browsers | |
} | |
if ( $.browser.safari ) | |
{ | |
// Bind 'mousewheel' for Safari |
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
"_fnDetectBrowser": function () | |
{ | |
var ua = navigator.userAgent.toLowerCase(); | |
// userAgent RegExp | |
var rwebkit = /(webkit)[ \/]([\w.]+)/, | |
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, | |
rmsie = /(msie) ([\w.]+)/, | |
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, | |
rsafari = /(safari)[ \/]([\w.]+)/, |
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
[aDictionary objectForKey:@"Key"] -> aDictionary[@"Key"] | |
========================================================= | |
Find | |
\[(\w+) *objectForKey: *(@"\w+") *\] | |
Replace | |
\1\[\2\] | |
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/sh | |
# insert_git_hash.sh | |
# ToGoOrder | |
# | |
# Created by John Haitas on 7/9/13. | |
# | |
# Location of Info.plist in build product | |
INFOPLISTPATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Info.plist" |
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/sh | |
# insert_git_hash.sh | |
# ToGoOrder | |
# | |
# Created by John Haitas on 7/9/13. | |
# | |
# Location of Info.plist in build product | |
INFOPLISTPATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Info.plist" |
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/sh | |
# insert_git_hash.sh | |
# ToGoOrder | |
# | |
# Created by John Haitas on 7/9/13. | |
# | |
# Location of Info.plist in build product | |
INFOPLISTPATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Info.plist" |
OlderNewer