Skip to content

Instantly share code, notes, and snippets.

View ratbeard's full-sized avatar

Mike Frawley ratbeard

View GitHub Profile
# 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
// map.js
function(doc) {
// !json sentences.sentences
var k
for (k in doc) {
if (sentences.sentences[k])
emit([doc._id, k], sentences.sentences[k]);
}
###########
# 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
###########
# 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
# `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
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
Here is a haml file with some styles and a little javascript:
!!!
%html
%head
%title Whats up dog??
%style
:sass
body
:text-align center
# 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
We couldn’t find that file to show.
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