Skip to content

Instantly share code, notes, and snippets.

View Undistraction's full-sized avatar

Pedr Browne Undistraction

View GitHub Profile
@tommarshall
tommarshall / simple_form.rb
Created August 22, 2013 14:58 — forked from clyfe/simple_form.rb
Bootstrap3 compatible simple_form initializer (with consistent Bootstrap 3 classes)
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
@kechol
kechol / seeds.rb
Created June 15, 2012 07:35
insert rails seeds from google spreadsheet
require 'rubygems'
require 'google_drive'
# set your username and password
login = GoogleDrive.login(GoogleDrive::USERNAME, GoogleDrive::PASSWORD)
# set your spreadsheet key
sheet = login.spreadsheet_by_key(GoogleDrive::SPREADSHEET)
sheet.worksheets.each do |ws|
p ws.title
@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@jwo
jwo / registrations_controller.rb
Created September 30, 2011 23:11
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else