This file contains hidden or 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
# aldershot.rb | |
=begin | |
main file for aldershot mountain. | |
aldershot mountain is/will be a (currently) | |
simple chutes and ladders/snakes and | |
ladder/adders and ladders/moksha patamu/ | |
gyanbazi/leela ripoff. | |
=end | |
This file contains hidden or 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
# The goal is to have all the words on one line, with "shoes" bold, larger, and a different color | |
Shoes.app do | |
background black | |
# Looks okay | |
flow do | |
subtitle "I want new ", | |
strong("shoes", :stroke => chocolate), |
This file contains hidden or 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
# | |
# tweet_beat.rb | |
# ShoesFest 2008 | |
# | |
# Created by Tamal White on 2008-07-25. | |
# Copyright 2008 Tamal White. All rights reserved. | |
# | |
require 'hpricot' | |
This file contains hidden or 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 'date' | |
class DateTime | |
def to_f | |
days_since_unix_epoch = self - ::DateTime.civil(1970) | |
(days_since_unix_epoch * 86_400).to_f | |
end | |
end | |
foo = DateTime.now |
This file contains hidden or 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 | |
regex='^[0-9]+$' | |
foo='1234' | |
bar='hi bean' | |
echo "foo = $foo" | |
if [[ "$foo" =~ $regex ]]; then |
This file contains hidden or 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 'time' | |
class Time | |
def in(tz) | |
current_tz = ENV["TZ"] | |
ENV["TZ"] = tz | |
new_time = self.getutc.getlocal | |
ENV["TZ"] = current_tz | |
new_time | |
end |
This file contains hidden or 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
# Models | |
class Agent < ActiveRecord::Base | |
belongs_to :manager | |
belongs_to :site | |
belongs_to :workgroup | |
end | |
class Manager < ActiveRecord::Base | |
has_many :agents |
This file contains hidden or 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 | |
require 'rubygems' | |
require 'net/http' | |
require 'hpricot' | |
class Twitter | |
def initialize(username, password) | |
This file contains hidden or 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 ruby | |
# Written by @tamalw for @jasonfried (http://twitter.com/jasonfried/status/1177797820) | |
# Portions of the Twitter class borrowed from @hagus (http://gist.github.com/41922) | |
require 'rubygems' | |
require 'net/http' | |
require 'hpricot' | |
class Twitter | |
This file contains hidden or 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 'sinatra' | |
require 'rack/utils' | |
@@datastore = [] | |
get '/' do | |
if params[:t] | |
@@datastore.unshift(Rack::Utils.unescape(params[:t])) | |
"a" |
OlderNewer