Skip to content

Instantly share code, notes, and snippets.

@cblunt
cblunt / Gemfile
Created October 21, 2011 08:55
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
@equivalent
equivalent / factories_inside_rails_console.rb
Created November 10, 2011 18:44
use factories inside rails console
require 'factory_girl'
require 'faker' #if needed
Dir[Rails.root.to_s + '/spec/factories/**/*.rb'].each {|file| require file }
@BPScott
BPScott / readme.md
Last active February 7, 2024 16:16
Github suggestion: Per-organization email overrides

This totally happened, y'all can stop +1ing this now. GitHub Blog post. Direct link to settings where you can set this.


#Per-organization / per-repo email overrides - A feature suggestion

Here the concepts "organization" and "user" are interchangeable, I'm talking about an entity that owns a repo, whether it is jQuery or John Resig. I'll stick to using organization as it best represents my original use-case.

##TL;DR

@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@blueheadpublishing
blueheadpublishing / erb_import_subtemplates.rb
Created December 6, 2011 19:00
ERB Subtemplating Script: Import ERB From Within ERB
# This script will take the file book.html.erb and parse it. When it encounters
# <%= import('your_file.html.erb') %> it will parse the file and stream
# it into the parent erb file.
require "erb"
class ErbImportSubtemplate
def self.import(file)
# Parse the source erb file
@flashingpumpkin
flashingpumpkin / ssh-host-complete.sh
Created December 8, 2011 14:26
Auto completing for some commands from your hosts file
#!/bin/bash
# Choose one
complete -W "$(grep -E '^[0-9]' /etc/hosts | awk '{ print $2 }')" ssh scp rsync ping
complete -W "$(grep -E '^ssh' ~/.bash_history | awk '{ print $2 }')" ssh scp rsync
complete -W "$(grep -E '^(\w)' ~/.ssh/known_hosts | awk '{ print $1 }' | sort -u | cut -d ',' -f 1)" ssh scp rsync ping
@ryanb
ryanb / index.js.erb
Created December 16, 2011 23:22
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>
@typeoneerror
typeoneerror / blah.sqlite
Created January 19, 2012 19:12
making sqlite cli not suck
sqlite> .mod col
sqlite> .headers on
@aemkei
aemkei / LICENSE.txt
Last active March 7, 2025 20:08 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE