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 Staff < Sequel::Model(:staff) | |
require 'sequel/extensions/pagination' | |
def box_times | |
if box | |
box.split(';#') | |
else | |
[] | |
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
rob@cosmo kiva (master) $ gfortran -o kiva3v *.F | |
begin.F:51.18: | |
call second(tstart) | |
1 | |
Error: 'time' argument of 'second' intrinsic at (1) must be of kind 4 | |
exitk.F:32.19: | |
call second (tfinish) | |
1 |
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
month = 5 | |
year = 2009 | |
century = (year - (year % 100))/100 | |
century_offset = ((39 - century) % 4) * 2 | |
is_leap = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0 | |
year_offset = ((year % 100) + (year % 100)/4) % 7 |
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 Story < Sequel::Model | |
require 'image_science' | |
attr_accessor :photo_upload | |
def after_save | |
super | |
process_upload! | |
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
require 'sinatra/base' | |
module Sinatra | |
module Editable | |
def self.registered(app) | |
app.set :editable_route, '/editable' | |
app.get "#{options.editable_route}/*" do |
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 'sequel' | |
DB = Sequel.connect('mysql://test:test@localhost/test') unless defined?(DB) | |
[:foos].each do |t| | |
DB.create_table? t do | |
primary_key :id | |
String :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
vi = w.vortices[step]; | |
fx = -vi.gamma * (vi.y - vi.yI)/w.dt; | |
fy = -vi.gamma * (vi.xI - vi.x)/w.dt; | |
/* average with previous shed vortex */ | |
if (step >= 1) { | |
vi = w.vortices[step - 1]; | |
fx = (fx + (-vi.gamma * (vi.y - vi.yI)/w.dt))/2.; | |
fy = (fy + (-vi.gamma * (vi.xI - vi.x)/w.dt))/2.; |
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 'formula' | |
def mysql_installed? | |
`which mysql_config`.length > 0 | |
end | |
class Php < Formula | |
url 'http://www.php.net/get/php-5.3.8.tar.gz/from/this/mirror' | |
homepage 'http://php.net/' |
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/ruby | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/FundingCircle/homebrew/tarball/master anywhere you like. | |
module Tty extend self | |
def blue; bold 34; end | |
def white; bold 39; end | |
def red; underline 31; end | |
def reset; escape 0; end | |
def bold n; escape "1;#{n}" 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
.DS_Store | |
Gemfile.lock | |
*.pem | |
node.json | |
tmp/* | |
!tmp/.gitignore |
OlderNewer