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
# 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?" |
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
require 'rubygems' | |
require 'eventmachine' | |
require 'digest/md5' | |
require 'base64' | |
require 'socket' | |
# Dunno, may need this later on. | |
class Session < Struct.new(:username, :id) | |
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
<p> | |
<%= form.label :name %><br /> | |
<%= form.text_field :name %> | |
</p> | |
<p> | |
<%= form.label :street_address1 %><br /> | |
<%= form.text_field :street_address1 %> | |
</p> | |
<p> |
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
$('form').submit(function(){ | |
$('input[type=image]', this).attr({disabled:'disabled'}); | |
}); |
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
$('form').submit(function(){ | |
$('input[type=image]', this).attr({disabled:'disabled'}); | |
}); |
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 | |
# 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; |
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
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 |
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
# 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 |
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 Link | |
attr_reader :url | |
def initialize(url) | |
@url = url | |
end | |
def bad? | |
return false if link.blank? | |
(GlobalPreference.get('suspicious_words') + GlobalPreference.get('bad_words')).any? { |word| url =~ eval("/#{word.strip}/") } |
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 Link | |
attr_reader :url | |
def initialize(url) | |
@url = url | |
end | |
def bad? | |
return false if link.blank? | |
(GlobalPreference.get('suspicious_words') + GlobalPreference.get('bad_words')).any? { |word| url =~ eval("/#{word.strip}/") } |
OlderNewer