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
execute pathogen#infect() | |
syntax on | |
filetype on | |
filetype plugin indent on | |
let g:solarized_termcolors=256 | |
let g:haskell_indent_case = 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
import string | |
import nltk.data | |
def reverse(sentence): | |
return sentence[::-1] | |
def stripped(sentence): | |
return "".join(sentence.split()) | |
def scrubbed(sentence): |
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 '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" |
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
use std::thread; | |
use std::sync::{Mutex, Arc}; | |
struct Philosopher { | |
name: String, | |
left: usize, | |
right: usize, | |
} | |
impl Philosopher { |
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
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); |
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
(/ | |
(+ 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))) |
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
import Data.Maybe | |
-- Lazy evaluation | |
natNums = [1..] | |
odds = [1,3..] | |
evens = [2,4..] | |
addXAndY :: Integer | |
addXAndY = sum | |
where x = 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
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 |
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
main :: IO() | |
main = do | |
putStrLn $ show result | |
where result = sum $ take 100000 (zipWith (*) [2,4..] [1,3..]) |
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 foo | |
puts "Foo!" | |
def bar | |
puts "Bar!" | |
end | |
end | |
begin | |
bar |