Skip to content

Instantly share code, notes, and snippets.

💭
Replacing Security Deposits

Bryan Woods bryanwoods

💭
Replacing Security Deposits
Block or report user

Report or block bryanwoods

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bryanwoods
bryanwoods / day1.hs
Last active Dec 2, 2019
Advent of Code 2019
View day1.hs
module Main where
elfFuel :: Int -> Int
elfFuel mass = mass `div` 3 - 2
cumulativeElfFuel :: Int -> Int
cumulativeElfFuel mass
| elfFuel mass <= 0 = 0
| mass > 0 = (elfFuel mass) + cumulativeElfFuel (elfFuel mass)
@bryanwoods
bryanwoods / day1.clj
Last active Dec 2, 2019
Advent of Code 2019
View day1.clj
(require '[clojure.string :as str])
(def masses
(map #(Integer/parseInt %)
(str/split (slurp "input") #"\n")))
(defn elf-fuel [mass]
(int (- (Math/floor (/ mass 3)) 2)))
(defn cumulative-elf-fuel [mass]
@bryanwoods
bryanwoods / hash_with_similar_access_warning.rb
Created Apr 4, 2018
Warn if a similar hash key exists to the one requested
View hash_with_similar_access_warning.rb
class Hash
def [](key)
result = fetch(key, nil) and
return result
keys.map(&:to_s).include?(key.to_s) or
return result
if [String, Symbol].include?(key.class)
send("similar_#{key.class.to_s.downcase}_key_warning", key)
View lyric_essay1.txt
jogle, onann’s bloom, me shisk in quent to regopll had you sich manceressescente. I have aney mior love of Gomarito amnersiin0.
Astee nor rommury of real. The rpolintirile dilins,y grobiclt in, insiblice uner thens.
At then chinging writh of mespy. There sould youts an burtig, astanNe the Nlommagiriligy. (99.. The last fass to crare-nor to thit a perfantef meose witelins no freer, I plappens whan thy thes dopny is lingor''l.
78"The U?TThrlre reeples abdage thin hantmers- aluy, I dint, and redersaitany, stubre peary confever of spemip wall, loslerf to Culost reautirg writion waly to that cans, nee it in the will il that o*?. Emm is to a smuesso. eelith, some whho deadt wing the dile to reith the meshed of alm the mearn: and thite acrise, these, alding the confoin -6 oret mease'd for treal whene I to her teilks, that am went, ints to susudation.
15 chan caxading the wrild at the nidversaliret faal cpusing of the cloldo, by doongan ? ied she boctuon becaunens no who de suks where a kerpastely shouthor thowen
View kafka.txt
the way of the door was still the door with his head and to see him that he was still said the door of the door and the three gentlemen stood a room with his head and to see him that he was still said the door of the door and the th
View flatten_everything.rb
module Enumerable
def method_missing(meth, *args, &block)
if "#{meth}" =~ /flat_(.*)/
send($1, *args, &block).flatten
else
super
end
end
def respond_to_missing?(meth, include_private = false)
View if-let.js
const RHS_OF_THE_BEAST = 246;
let ifLet = (binding, then) => {
let b = binding.slice(0, binding.indexOf("="));
return eval(binding) && then.call(this, eval(b));
};
let fn = (y) => y + RHS_OF_THE_BEAST;
let reverseNumber = (number) => number.toString().split('').reverse().join('');
View .vimrc
execute pathogen#infect()
syntax on
filetype on
filetype plugin indent on
let g:haskell_indent_case = 2
let g:Guifont="Monaco:h18.00"
let test#strategy = "neovim"
View novel1.rb
require 'pry'
words = [].tap do |word_list|
Dir["/usr/share/dict/*"].each do |filename|
File.readlines(filename).each do |word|
word_list.push(word.strip)
end
end
end.flatten
View .vimrc
execute pathogen#infect()
syntax on
filetype on
filetype plugin indent on
let g:solarized_termcolors=256
let g:haskell_indent_case = 2
You can’t perform that action at this time.