Skip to content

Instantly share code, notes, and snippets.

@alloy-d
alloy-d / yolo-hash.rb
Created August 6, 2014 18:15
YOLOHash: stop caring about all that "strings vs symbols" nonsense
class YOLOHash < Hash
def [](key)
super(key.send((rand(2) % 2 == 1) ? :to_sym : :to_s))
end
def []=(key,val)
super(key.send((rand(2) % 2 == 1) ? :to_sym : :to_s), val)
end
end
@alloy-d
alloy-d / fun-with-marquees.html
Created June 1, 2014 14:48
Truly some of my best work.
<!DOCTYPE html>
<html>
<head>
<title>DAMMIT BILL</title>
<style>
html, body { height: 100%; }
body {
font-family: "Helvetica Neue", sans-serif;
font-size: 110px;
text-transform: uppercase;

Web Developer

Location: New York, NY
Type: Full-time
Experience: Mid-level

At [Jibe][jibe], we make software to help Fortune 1000 and blue chip companies hire more effectively, and make the process of applying for those jobs less painful. Our clients love us, and we're growing like crazy.

Technical Support / Integrations Developer

Location: New York, NY
Type: Full-time
Experience: Entry-level

At [Jibe][jibe], we make software to help Fortune 1000 and blue chip companies hire more effectively, and make the process of applying for those jobs less painful. Our clients love us, and we're growing like crazy.

@alloy-d
alloy-d / censored_exception.rb
Created February 11, 2014 20:29
Censoring wordy exceptions.
require 'active_support/backtrace_cleaner'
module CensoredException
def self.extended(base)
orig_backtrace = base.method(:backtrace)
base.define_singleton_method(:backtrace) do
BACKTRACE_CLEANER.clean(orig_backtrace.call)
end
end
@alloy-d
alloy-d / access-recorder.rb
Last active December 28, 2015 17:28
Record (basic) field accesses. Intended for use in Mustache templates.
require 'set'
class AccessRecorder
attr_reader :accessed
def initialize
@accessed = Set.new
end
def has_key?(*args) true end
def [](key)
@alloy-d
alloy-d / gist:7238534
Created October 30, 2013 19:21
git ls-files --recursive
git ls-files; git submodule foreach 'for file in $(git ls-files); do echo "$path/$file"; done' | grep -ve '^Entering '
@alloy-d
alloy-d / hash-set-logic.rb
Created October 16, 2013 18:00
Set logic for Ruby hashes. Somehow nothing like this is built in.
require 'set'
class Hash
# Returns true if the set of this Hash's key/value pairs
# is a superset of the given hash's key/value pairs.
#
# See Set#superset?
def superhash?(hash)
self.to_set.superset?(hash.to_set)
end
@alloy-d
alloy-d / work-with-me.markdown
Last active December 24, 2015 15:09
Come work with me at Jibe!

Come work with me!

I'm looking for some Ruby/JS/web development people to come work with me at [Jibe][jibe]!

What do we do?

At Jibe, we provide tools and applications to help our clients distribute their message to more job seekers, and provide solutions to help their prospective employees navigate the application process with ease.

@alloy-d
alloy-d / classify.rb
Created September 26, 2013 20:13
A hacky method for classifying things based on user input.
classify = ->(list, ider) do
groups = {}
list.each do |thing|
print "#{ider.call(thing)} "
(groups[gets.chomp.intern]||=[]) << thing
end
groups
end