Skip to content

Instantly share code, notes, and snippets.

View gertig's full-sized avatar

Andrew Gertig gertig

View GitHub Profile
@gertig
gertig / devise_ajax_signup
Created August 17, 2011 19:31
Devise Ajax Signup
#registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
def create
params[:user][:password_confirmation] = params[:user][:password]
super
end
end
<!-- Inside any View --->
<%= form_for(:user, :url => "#", :html => { :id => "ajax_signup"}) do |f| %>
@gertig
gertig / devise_ajax_signup
Created August 17, 2011 19:31
Devise Ajax Signup
#registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
def create
params[:user][:password_confirmation] = params[:user][:password]
super
end
end
<!-- Inside any View --->
<%= form_for(:user, :url => "#", :html => { :id => "ajax_signup"}) do |f| %>
@gertig
gertig / gist:988056
Created May 24, 2011 02:40 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this screencast if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent then a phone call or screen sharing.
@gertig
gertig / index.html.erb
Created April 27, 2011 15:16
Learning Backbone - index.html.erb file
<h1>All Dogs</h1>
<div id="dogsapp">
<div id="dogs">
<table id="dog-table">
<tr>
<th>Name</th>
<th>Color</th>
<th>Age</th>
</tr>
@gertig
gertig / app.js
Created April 27, 2011 15:13
Learning Backbone
//Trying to put it all in one file then break it out later.
// Load the application once the DOM is ready
$(function(){
////////////////////////////////////////////////////////
// Dog Model
////////////////////////////////////////////////////////
window.Dog = Backbone.Model.extend({
@gertig
gertig / css_transform_rotate.css
Created April 12, 2011 15:10
Rotate a div with CSS by adding a class to it.
/* Compass .scss for rotating the div when the class of .open is added to it and rotating back when it is removed */
#direction_arrow {
position: absolute;
right: 5px;
top: 135px;
cursor: pointer;
z-index: 999999;
-webkit-transition: all 0.1s linear;
&.open {
www:
requirements:
- faye
- jade
class InvitationsController < Devise::InvitationsController
include Devise::Controllers::InternalHelpers #not sure if this is necessary
# POST /resource/invitation
def create
#Assuming the user_id of the gifted user is = 1
if current_user.id == 1
current_user.increment!(:invitation_limit)
@gertig
gertig / Gemfile
Created March 27, 2011 15:34
To use devise_invitable "invitation_limit" add these to your Gemfile
gem 'devise', '~> 1.2.0'
gem 'devise_invitable', '~> 0.4.rc5'
@gertig
gertig / devise_invitable_add_to_users.rb
Created March 27, 2011 15:07
devise_invitable migration file if adding to existing Model
class DeviseInvitableAddToUsers < ActiveRecord::Migration
def self.up
change_table :users do |t|
t.string :invitation_token, :limit => 60
t.datetime :invitation_sent_at
t.index :invitation_token
t.integer :invitation_limit
t.integer :invited_by_id
t.string :invited_by_type
end