Skip to content

Instantly share code, notes, and snippets.

View gaygenius's full-sized avatar

José J. Capó gaygenius

  • San Francisco, CA
View GitHub Profile
@gaygenius
gaygenius / groupPhotos.rb
Created November 3, 2013 19:24
Group photos that are grouped in date directories into month directories
#!/usr/bin/env ruby -w
require 'fileutils'
Dir.chdir('/users/josecapo/Pictures')
months = Dir['201?-??-??'].map {|date| date[0..6]}.uniq
months.each do |month|
FileUtils.mkdir_p(month)
Dir["#{month}-*"].each do |date|
@gaygenius
gaygenius / index.html.haml
Created February 3, 2012 20:26
Place index view using backbone.js (in app/views/places)
#places
:javascript
$(function() {
window.router = new BackboneJs.Routers.PlacesRouter({places: #{@places.to_json.html_safe}});
Backbone.history.start();
});
@gaygenius
gaygenius / Gemfile
Created February 3, 2012 19:52
Rails 3.2 Gemfile for Heroku
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
gem 'heroku'
@gaygenius
gaygenius / Gemfile
Created February 3, 2012 19:38
Rails 3.2.1 Gemfile for Heroku with haml, rspec and backbone.js
source 'https://rubygems.org'
gem 'rails', '3.2.1'
gem 'haml-rails'
gem 'rails-backbone'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do