List of helpful shortcuts for faster coding
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
module Devise | |
module Models | |
module RemoteAuthenticatable | |
extend ActiveSupport::Concern | |
# | |
# Here you do the request to the external webservice | |
# | |
# If the authentication is successful you should return | |
# a resource instance |
module Devise | |
module Strategies | |
class RemoteAuthenticatable < Authenticatable | |
# | |
# For an example check : https://github.com/plataformatec/devise/blob/master/lib/devise/strategies/database_authenticatable.rb | |
# | |
# Method called by warden to authenticate a resource. | |
# | |
def authenticate! | |
# |
require "dim" | |
AppContainer = Dim::Container.new | |
AppContainer.register(:env) { ENV['ADWORK_ENV'] || "development" } | |
AppContainer.register(:production?) { |c| c.env == 'production' } | |
AppContainer.register(:development?) { |c| c.env == 'development' } | |
AppContainer.register(:test?) { |c| c.env == 'test' } | |
AppContainer.register(:root) { File.expand_path(File.dirname(__FILE__)+"/../..") } | |
AppContainer.register(:logger) do |c| |
" Vim functions to run RSpec and Cucumber on the current file and optionally on | |
" the spec/scenario under the cursor. | |
function! RailsScriptIfExists(name) | |
" Bundle exec | |
if isdirectory(".bundle") || (exists("b:rails_root") && isdirectory(b:rails_root . "/.bundle")) | |
return "bundle exec " . a:name | |
" System Binary | |
else | |
return a:name |
module AdsenseHelper | |
# Author: Tomasz Mazur ([email protected]) | |
# http://www.mydigitallife.info/2009/01/17/google-adsense-legacy-old-generation-code-reference-generate-and-get/ | |
# :slot | |
# :theme | |
# :background | |
# :border | |
# :link | |
# :text |
# rails new my_app_name -J -T -m http://gist.github.com/635287.txt | |
remove_file 'Gemfile' | |
create_file 'Gemfile', <<-GEMFILE | |
source 'http://rubygems.org' | |
source 'http://gems.github.com' | |
gem 'rails' | |
gem 'sqlite3-ruby', :require => 'sqlite3' | |
gem 'pg', :group => :production |
# Application Generator Template | |
# Devise, Cucumber, RSpec... for use with Rails 3 | |
# http://gist.github.com/513564 | |
# Based on the Mongoid/Devise template: http://github.com/fortuity/rails3-mongoid-devise/raw/master/template.rb | |
# | |
# | |
# Installs my js_lib rakefile, found: http://gist.github.com/raw/628715/js_lib.rake | |
# (to keep js libraries out of source control.) | |
# | |
# Usage: |