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
ERROR ArgumentError: wrong number of arguments(1 for 0) | |
/Users/evizitei/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/bundler/gems/railslts-6e830c6c9784/actionpack/lib/action_controller/middleware_stack.rb:72:in `initialize' | |
/Users/evizitei/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/bundler/gems/railslts-6e830c6c9784/actionpack/lib/action_controller/middleware_stack.rb:72:in `new' | |
/Users/evizitei/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/bundler/gems/railslts-6e830c6c9784/actionpack/lib/action_controller/middleware_stack.rb:72:in `build' | |
/Users/evizitei/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/bundler/gems/railslts-6e830c6c9784/actionpack/lib/action_controller/middleware_stack.rb:116:in `block in build' | |
/Users/evizitei/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/bundler/gems/railslts-6e830c6c9784/actionpack/lib/action_controller/middleware_stack.rb:116:in `each' | |
/Users/evizitei/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/bundler/gems/railslts-6e830c6c9784/actionpack/lib/action_con |
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' | |
dir = '/Users/evizitei/Code/instructure/canvas-lms' | |
Dir.chdir dir | |
shas =`git log --oneline --since='4 weeks ago' | cut -f 1 -d ' '` | |
def is_a_problem?(sha) | |
files = (`git diff --name-only #{sha} #{sha}~1`) | |
((files =~ /^(app|public).*\.(coffee|js)$/ && | |
!(files =~ /^spec.*\.(coffee|js)$/)) || |
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
Joel (on Software): http://www.joelonsoftware.com/articles/fog0000000043.html | |
Agile Advocates: http://www.ministryoftesting.com/2013/06/ten-reasons-why-you-fix-bugs-as-soon-as-you-find-them/ | |
Gregg Boer, an employee of the most corporate-y company on the planet (sorry, David…): http://visualstudiomagazine.com/articles/2012/10/12/agile-bug-management.aspx | |
Independent game developers: http://www.gamedev.net/page/resources/_/technical/general-programming/zero-defect-software-development-r1050 | |
Paul Graham: http://www.paulgraham.com/road.html |
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 Prime | |
PRIMES = [2, 3] | |
def self.nth(index) | |
raise ArgumentError if index < 1 | |
return PRIMES[index - 1] if PRIMES.length >= index | |
generate_primes_up_to(index) | |
end | |
def self.generate_primes_up_to(index) |
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/bash | |
# when processing receipts, I need to have them rotated 90-deg and | |
# flipped horizontally because of how photobooth stores them. | |
# Iterate through all the files in the directory, rotate, and flip | |
for file in *.* | |
do | |
sips -r 90 "$file" | |
sips -f horizontal "$file" | |
done |
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 Reporter | |
class << self | |
def run_example_report(person,start_date,end_date) | |
sd_string = start_date.strftime("%Y%m%d") | |
ed_string = end_date.strftime("%Y%m%d") | |
filename = "#{person.name}_report_for_#{sd_string}_#{ed_string}" | |
self.run_report(filename,"EXAMPLE") do |sheet| | |
sheet.add_row [person.name] |
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 | |
desc "abort rake if using bad memory techniques" | |
task :safety_migrate => :environment do | |
path = "#{RAILS_ROOT}/db/migrate/" | |
migration_directory = Dir.new(path) | |
proceed = true | |
migration_directory.each do |file| | |
if file != "." and file != ".." | |
migration = File.open("#{path}#{file}") | |
text = migration.read |
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 File | |
def uber_gets(delimiter) | |
segment = "" | |
self.each_byte do |byte| | |
char = byte.chr | |
if char == delimiter | |
yield segment | |
segment = "" | |
else | |
segment = "#{segment}#{char}" |
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 'roo' | |
require 'csv' | |
class SpreadsheetParser | |
def self.parse(file) | |
name = file.path | |
if name =~ /\.csv/ | |
CSV::Reader.parse(file).each do |row| | |
yield row |
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 BjJob < ActiveRecord::Base | |
set_table_name "bj_job" | |
set_primary_key "bj_job_id" | |
end |
OlderNewer