Skip to content

Instantly share code, notes, and snippets.

@slant
slant / concerned.rb
Created May 3, 2012 05:50
A file to demonstrate the difference between extending with ActiveSupport::Concern and without
require 'rubygems'
require 'active_support'
module Stuff
# New hotness
extend ActiveSupport::Concern
def whatnot
6
@slant
slant / pianobar-notifier.rb
Created January 24, 2012 07:57
Growl notifications for Pianobar
#!/usr/bin/ruby
require 'open-uri'
require 'tempfile'
def cover_art url
extname = File.extname(url)
basename = File.basename(url, extname)
file = Tempfile.new([basename, extname])
file.binmode
@slant
slant / hello.js
Created January 22, 2012 01:23
Language comparisons
thing = {
say: function(something){ return something; }
}
document.write(thing.say('hello'))
@slant
slant / gist:1228442
Created September 20, 2011 05:45
Enclave Plans
Daily and Weekly
Come in during our business hours and get some work done!
Full-Time (Monthly)
Bring your setup in for the day and take it back home at night
24/7 access
Use the address to receive mail
Permanent Desk (Monthly)
Claim a desk as your own. It's your desk! Keep your stuff there.
@slant
slant / cloudapp.rb
Created August 17, 2011 16:07 — forked from aashay/cloudapp.rb
CloudApp script
#!/usr/bin/env ruby
#
# cloudapp
# Hacked together with duct tape, hopes, and dreams by Aashay Desai / @aashay
# Original by Zach Holman / @holman
#
# Uploads a file from the command line to CloudApp, drops it into your clipboard
#
# Example:
#
@slant
slant / config.php
Created March 21, 2011 19:08
An example to demonstrate why you should never store passwords in web-accessible PHP files.
# Located one level below the DocumentRoot
<?php $secure_password = "i_am_so_smrt"; ?>
<%= User.where(:archived => true).each { |u| user.name } %>
@users.collect(&:name)
# View users/index
<%= User.where(:archived => true).each { |u| user.name } %>
http://google.com/bookmarks/find?&q=%s