Skip to content

Instantly share code, notes, and snippets.

# download, from_repo, and commit_state methods swiped from
# http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb
require 'open-uri'
def download(from, to = from.split("/").last)
#run "curl -s -L #{from} > #{to}"
file to, open(from).read
rescue
puts "Can't get #{from} - Internet down?"
require 'rubygems'
require 'eventmachine'
require 'digest/md5'
require 'base64'
require 'socket'
# Dunno, may need this later on.
class Session < Struct.new(:username, :id)
end
<p>
<%= form.label :name %><br />
<%= form.text_field :name %>
</p>
<p>
<%= form.label :street_address1 %><br />
<%= form.text_field :street_address1 %>
</p>
<p>
$('form').submit(function(){
$('input[type=image]', this).attr({disabled:'disabled'});
});
$('form').submit(function(){
$('input[type=image]', this).attr({disabled:'disabled'});
});
#!/bin/sh
# setup ------------------------------------------------------------------------
tempDir="/tmp/`whoami`/chrome-nightly/";
baseURL="http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/";
baseName="chrome-mac";
baseExt="zip";
appName="Chromium.app";
appDir="/Applications";
version=~/.CURRENT_CHROME;
@eladmeidar
eladmeidar / gist:302096
Created February 11, 2010 23:13 — forked from Omer/gist:302094
module AssignmentsHelper
def assignment_statistics_probability
# (@assignments.map {|assignment| assignment.probability_grade }.inject(:+) / (@assignments.length.to_f * 12)) * 100
(@assignments.collect(&:probability_grade).sum / (@assignments.length.to_f * 12)) * 100
end
def assignment_statistics_geometry
(@assignments.map {|assignment| assignment.geometry_grade }.inject(:+) / (@assignments.length.to_f * 12)) * 100
end
def assignment_statistics_weeks
@assignments.length
@eladmeidar
eladmeidar / Gemfile
Created February 18, 2010 17:02 — forked from indirect/Gemfile
Bundler on 2.3.5
# include at least one source and the rails gem
source :gemcutter
gem "rails", "~> 2.3.5", :require => nil
gem "sqlite3-ruby", :require => "sqlite3"
group :development do
# bundler requires these gems in development
gem 'rails-footnotes'
end
@eladmeidar
eladmeidar / link.rb
Created February 3, 2011 21:39 — forked from ratnikov/link.rb
@eladmeidar
eladmeidar / link.rb
Created February 4, 2011 13:28 — forked from ratnikov/link.rb