Skip to content

Instantly share code, notes, and snippets.

@bcardiff
bcardiff / ast_dump.cr
Created June 30, 2015 21:58
Crystal AST dump
require "compiler/crystal/**"
class Object
def dump_inspect(io, level)
io << " " * level
to_s(io)
io << " :: " << self.class
end
end
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@d3noob
d3noob / .block
Last active July 11, 2023 19:59
Simple vertical d3.js tree diagram
license: mit
@kaeff
kaeff / .bowerrc
Last active December 15, 2015 22:50
How to use Bower with the Asset Pipeline in Rails
{
"directory" : "vendor/assets/components"
}
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@