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
\version "2.13.52" | |
melody = \relative c'' { | |
\clef treble | |
\key a \major | |
\override Staff.TimeSignature #'style = #'() | |
\time 4/4 | |
\autoBeamOn | |
\partial 4 s4 | |
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
############################################################################# | |
# to use this in jruby: | |
# | |
# jgem install sequel | |
# jgem install jdbc-sqlite3 | |
# | |
# for more info on the sequel library, go to http://sequel.rubyforge.org/ | |
############################################################################# | |
require 'rubygems' |
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 | |
export MAKE_J=4 | |
export EDITOR='mate' | |
export CLICOLOR=1 | |
export LSCOLORS=gxfxcxdxbxegedabagacad | |
export JAVA_HOME=$(/usr/libexec/java_home) | |
export M2_HOME="/usr/local/Cellar/maven/3.0.3/libexec" | |
export M2="$M2_HOME/bin" | |
export MAVEN_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=512m" |
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
Capybara.run_server = false | |
[:firefox, :chrome, :ie].each do |browser| | |
Capybara.register_driver "selenium_#{browser}".to_sym do |app| | |
Capybara::Selenium::Driver.new(app, :browser => browser) | |
end | |
Capybara.register_driver "selenium_remote_#{browser}".to_sym do |app| | |
host = ENV['SELENIUM_HOST'] | |
options = { | |
:browser => :remote, |
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
function setup() | |
font = DotFont() | |
color = {{255, 0, 0}, {255, 255, 0}} | |
end | |
function draw() | |
background(7, 7, 7, 255) | |
rectMode(CORNER) |
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
namespace :db do | |
task :nuke => :environment do | |
abcs = ActiveRecord::Base.configurations | |
["development", "test"].each do |db| | |
case abcs[db]["adapter"] | |
when "oci" | |
ActiveRecord::Base.establish_connection(db.to_sym) | |
conn = ActiveRecord::Base.connection | |
conn.begin_db_transaction | |
conn.tables.each do |table| |
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 Array | |
def sum | |
inject(0.0) { |result, el| result + el } | |
end | |
def mean | |
sum / size | |
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
class Array | |
def my_each | |
length.times do |index| | |
yield(self[index]) | |
end | |
end | |
def my_inject(initial_value) | |
accumulator = initial_value || self.dup.shift | |
my_each do |item| |
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 'processor.rb' | |
task :parse do | |
p = Processor.new | |
p.parse | |
end | |
task :default => :parse |
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 Array | |
def sum | |
inject(0.0) { |result, el| result + el } | |
end | |
def mean | |
sum / size | |
end | |
end |