Apples 12 Days of Christmas style created using html5 canvas and css3, and instead counting down the days until christmas :D
A Pen by Lennart Hase on CodePen.
Apples 12 Days of Christmas style created using html5 canvas and css3, and instead counting down the days until christmas :D
A Pen by Lennart Hase on CodePen.
Forked from dodozhang21's Pen Four Seasons (playing with filters).
A Pen by feipinghuang on CodePen.
| require 'strong_parameters' | |
| class ActiveRecord::Base | |
| include ActiveModel::ForbiddenAttributesProtection | |
| end | |
| class ActionController::Base | |
| # Use this with CanCan's load_resource to permit a set of params before | |
| # it tries to build or update a resource with them. |
| #!/bin/sh | |
| # if you're using ZSH, change the shebang above to "#!/bin/zsh -i" | |
| if [ ${#} -ne 2 ]; then | |
| echo >&2 Usage: $(basename ${0}) old-version new-version | |
| exit 1 | |
| fi | |
| home_path=$(cd ~; pwd -P) | |
| old_version=${1} |
| class User < ActiveRecord::Base | |
| # ... lots of persistence stuff | |
| end | |
| class GitHubUserProvisioner < SimpleDelegator | |
| def provision_with!(user_info, extra_user_hash) | |
| self.github_login = extra_user_hash['login'] | |
| self.name = user_info['name'] | |
| self.email = user_info['email'] | |
| self.github_url = user_info['urls']['GitHub'] |
| require 'cgi' | |
| require 'digest/md5' | |
| require 'net/https' | |
| require 'uri' | |
| module Jekyll | |
| class GistTag < Liquid::Tag | |
| def initialize(tag_name, text, token) | |
| super | |
| @text = text |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.
| # app/controllers/users/password_controller.rb | |
| class Users::PasswordsController < Devise::PasswordsController | |
| def resource_params | |
| params.require(:user).permit(:email, :password, :password_confirmation) | |
| end | |
| private :resource_params | |
| end |
| 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 |