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
# Hey coops.. | |
# | |
# Imagine yourself on the other side of the table: two job openings, hundreds of resumes, | |
# _all of which_ look friggin' identical. Yeah, the HR departments at your MegaCorp XYZ are using | |
# automated tools to scan for keywords, and the coop department at your school is trying to beat | |
# you into submission to follow some "predefined template".. But, unless what you're aspiring to | |
# is to be an automaton at MegaCorp XYZ, relegated to writing test harnesses for code that will | |
# never see the light of day.. please do yourself a favor, and _be different_! Be bold, dammit. | |
# | |
# (Frankly, I'm falling asleep while reading your resumes.. Wake me up! Srsly.) |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
@user = User.find(:all) | |
@users.each do |fbid| | |
result = JSON.parse(open(URI.encode("https://graph.facebook.com/me/friends?access_token=#{fbid.utoken}")).read) | |
@friendsp = result['data'][0]['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
<td><%= link_to transferred_from(call), call %></td> | |
<td><%= link_to transferred_to(call), call %></td> |
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 Punch < ActiveRecord::Base | |
attr_accessible :clock_in, :clock_out | |
belongs_to :user | |
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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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 TimeFormatter | |
def self.format_time(elapsed) | |
return if elapsed.nil? | |
seconds = elapsed % 60 | |
minutes = (elapsed / 60) % 60 | |
hours = (elapsed / 3600) | |
"%d:%02d:%02d" % [hours, minutes,seconds] | |
# hours.to_s + ":" + format("%02d",minutes.to_s) + ":" + format("%02d",seconds.to_s) |
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
def index | |
@calls = Call.report(params[:search]) | |
respond_to do |format| | |
format.html do | |
@calls.paginate(:per_page => 10, :page => params[:page]) | |
end | |
format.csv { send_data @calls.to_csv } | |
format.xls { send_data @calls.to_csv(col_sep: "\t") } | |
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
def close_call(medic, call) | |
@call = call | |
@medic = medic | |
recipients = [@medic.medic_sms, @medic.medic_email] | |
recipients << @call.transferred_from.facility_email if @call.transferred_from.facility_email? | |
mail to: recipients, subject: "Call Complete: #{@call.incident_number}" | |
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 RepliesController < ApplicationController | |
require "time" | |
skip_before_filter :verify_authenticity_token | |
skip_before_filter :authenticate_teacher! | |
def receive | |
# 1. set a @parent based on phone number and/or course number if they exist | |
# 2/ you then move on to the next state on the parent | |
@reply = Reply.new |
OlderNewer