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
# see http://troy.yort.com/short-fast-micro-whois | |
# original http://gist.github.com/82956 | |
# 0 if available | |
# 1 if taken | |
d () { | |
# Append ".com" to input if doesn't contain a ".": | |
domain=$1 | |
if [[ ! $1 =~ \.\w+$ ]]; then | |
domain=$domain.com | |
fi |
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
// map.js | |
function(doc) { | |
// !json sentences.sentences | |
var k | |
for (k in doc) { | |
if (sentences.sentences[k]) | |
emit([doc._id, k], sentences.sentences[k]); | |
} |
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
########### | |
# Dirs # | |
########### | |
export pdir='~/dev/project' | |
export gdir=`gem env gemdir` # /Library/Ruby/Gems/1.8/gems | |
export rdir='~/dev/repos' | |
alias cdp="cd $pdir" # projects | |
alias cdg="cd $gdir/gems" # gems | |
alias cdr="cd $rdir" # repos |
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
########### | |
# Dirs # | |
########### | |
export pdir='~/dev/project' | |
export gdir=`gem env gemdir` # /Library/Ruby/Gems/1.8/gems | |
export rdir='~/dev/repos' | |
alias cdp="cd $pdir" # projects | |
alias cdg="cd $gdir/gems" # gems | |
alias cdr="cd $rdir" # repos |
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
# `irb` console session. | |
# Making a class, making it comparable, overriding its display formats, and using map! | |
# Make a class that mixins Comparable and defines <=> so it gets all <, ==, >, etc. | |
# Other methods like Array.sort will now work too | |
>> class Box | |
>> def <=>(other) | |
>> [source, color] <=> [other.source, other.color] | |
>> 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
describe 'Creating a Sheet...' | |
setup_page(1, function () { | |
pane = new Ext.ux.NewSheet() | |
area = display(pane, '#new-sheet') | |
form = pane.items.get(0).getForm(); | |
^ | |
.., must specify a unique sheet id ... | |
.., in an input box |
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
Here is a haml file with some styles and a little javascript: | |
!!! | |
%html | |
%head | |
%title Whats up dog?? | |
%style | |
:sass | |
body | |
:text-align center |
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
# assumes you've got a copy of 'who let the dogs out' in your tmp dir | |
require 'rubygems' | |
require 'rest_client' | |
$url = "http://www.brownpapertickets.com/event/72123" | |
def site_up? | |
RestClient::get($url) rescue false | |
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
This illustrates the problem better: | |
something_that_will_insert_element_in_page() | |
console.log('length:::'); | |
console.log($('#calc_historical_field').length); // 0 | |
(function () { | |
console.log('length::::'); | |
console.log($('#calc_historical_field').length); // 1 |
OlderNewer