Skip to content

Instantly share code, notes, and snippets.

@sandstrom
sandstrom / example.rb
Created September 6, 2017 11:24 — forked from mislav/example.rb
Dump objects into YAML using specific style
full_data = {
response: {body: StyledYAML.literal(DATA.read), status: 200},
person: StyledYAML.inline('name' => 'Steve', 'age' => 24),
array: StyledYAML.inline(%w[ apples bananas oranges ])
}
StyledYAML.dump full_data, $stdout
__END__
{
Katy Perry - The One That Got Away
Summer after high school when we first met
We make out in your Mustang to Radiohead
And on my 18th birthday
We got matching tattoos
Used to steal your parents' liquor
And climb to the roof
Talk about our future
@sandstrom
sandstrom / fast_select.js
Last active December 16, 2015 12:49
Faster Em.Select
// A static select where options aren't child-views but plain option tags.
// This implementation is currently much faster than Em.Select on large collections.
(function() {
// shortcuts
var set = Em.set, get = Em.get;
Em.FastSelect = Em.Select.extend({
@sandstrom
sandstrom / hack.sh
Created March 31, 2012 17:15 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
The Killers - Uncle Johnny
When everybody else refrained
My uncle Johnny did cocaine
He's convinced himself right in his brain
That it helps to take away the pain
Hey, Johnny
Hey what you say Johnny
I wanna go out tonight