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
# will not pair people with a member of their houshold | |
households = [%w(Jeannie Terry\ Snr), ["Benton"], ["Terry"], %w(Mandy Marcos Elías Mateo), %w(Erin Matt)] | |
households.sort!{|a,b| b.length <=> a.length} | |
names = households.flatten | |
pairs = {} | |
names.each do |name| | |
household = households.find{|h| h.include?(name)} | |
available_names = (names - pairs.values - household) |
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 Talkbox | |
USER = ENV['TALKBOX_USER'] | |
PASS = ENV['TALKBOX_PASS'] | |
BASE_URL = ENV['TALKBOX_API_URL'] | |
def self.get entity | |
url = "#{BASE_URL}/#{entity}" | |
response = RestClient::Request.execute method: :get, url: url, user: USER, password: PASS | |
JSON.parse(response.body) |
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
#print-only { | |
visibility: hidden; | |
} | |
@media print { | |
body * { | |
visibility: hidden; | |
} | |
#print-only, #print-only * { |
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 'HTTParty' | |
class SquawkboxAPI | |
include HTTParty | |
def initialize(username, password) | |
@auth = {:username => username, :password => password} | |
@squawkbox_host = 'app.mysquawkbox.com' | |
self.class.base_uri URI::HTTPS.build(host: @squawkbox_host, path: '/service/v1').to_s | |
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
package main | |
import "math" | |
func main() { | |
s := Sphere{center: Point{0, 0, 0}, radius: 1} | |
p := Point{0.1, 0.1, 0.1} | |
println(s.contains(p)) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>TrelloView</title> | |
<!-- Bootstrap --> |
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' | |
require 'trello' | |
get '/' do | |
Trello.configure do |config| | |
config.developer_public_key = ASK_MATT | |
config.member_token = ASK_MATT | |
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' | |
require 'zendesk_api' | |
require 'logger' | |
require 'haml' | |
# launch with > rerun 'rackup' | |
class ZenDash < Sinatra::Base | |
def initialize |
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 'time' | |
# TODO: | |
# | |
# add enquire links (done) | |
# and enquire link responses (done) | |
# add restart events on a thread (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
# looking at a simple set of back prices ('payouts') | |
class Book | |
def initialize (payouts) | |
@payouts = payouts | |
end | |
def probabilities | |
@payouts.map{|p| 1.0/p} | |
end |
NewerOlder