Skip to content

Instantly share code, notes, and snippets.

View bryanwoods's full-sized avatar
💭
Replacing Security Deposits

Bryan Woods bryanwoods

💭
Replacing Security Deposits
View GitHub Profile
execute pathogen#infect()
syntax on
filetype on
filetype plugin indent on
let g:solarized_termcolors=256
let g:haskell_indent_case = 2
import string
import nltk.data
def reverse(sentence):
return sentence[::-1]
def stripped(sentence):
return "".join(sentence.split())
def scrubbed(sentence):
require 'active_support/core_ext/string'
class MyFakeActiveRecord
def pluralized_table
self.class.name.underscore.downcase.pluralize
end
def self.has_many(association)
define_method(association) do
"INNER JOIN #{association} ON #{association}.id = #{pluralized_table}.id"
use std::thread;
use std::sync::{Mutex, Arc};
struct Philosopher {
name: String,
left: usize,
right: usize,
}
impl Philosopher {
extern crate rand;
use std::io;
use std::cmp::Ordering;
use rand::Rng;
fn main() {
println!("Guess the number!");
let secret_number = rand::thread_rng().gen_range(1, 101);
(/
(+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5)))))
(* 3 (- 6 2) (- 2 7)))
(defn square [x]
(* x x))
(defn sum-of-squares [x y]
(+ (square x) (square y)))
import Data.Maybe
-- Lazy evaluation
natNums = [1..]
odds = [1,3..]
evens = [2,4..]
addXAndY :: Integer
addXAndY = sum
where x = 1
@bryanwoods
bryanwoods / favoritebooks.txt
Created December 17, 2013 18:56
My favorite books I read in 2013, alphabetical by author's name
The Verificationist - Donald Antrim
what purpose did i serve in your life - Marie Calloway
The Last Samurai - Helen DeWitt
The White Album - Joan Didion
The Orphan Master's Son - Adam Johnson
Taipei - Tao Lin
The Twelve Tribes of Hattie - Ayana Mathis
The Road - Cormac McCarthy
Swamplandia! - Karen Russell
Journalism - Joe Sacco
@bryanwoods
bryanwoods / s.hs
Last active December 29, 2015 05:19
Feeling lazy
main :: IO()
main = do
putStrLn $ show result
where result = sum $ take 100000 (zipWith (*) [2,4..] [1,3..])
@bryanwoods
bryanwoods / scratch.rb
Created October 17, 2013 14:24
Seems unfortunate
def foo
puts "Foo!"
def bar
puts "Bar!"
end
end
begin
bar