gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
- Hookshot
- Adblock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class @GoogleAnalytics | |
@load: -> | |
# Load the analytics code | |
window['GoogleAnalyticsObject'] = 'ga' | |
window['ga'] = window['ga'] || -> | |
(window['ga'].q = window['ga'].q || []).push arguments | |
window['ga'].l = 1 * new Date() | |
# Add the script |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --install
will prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Block Grid | |
// Technique adapted from Foundation 5 for Bootstrap 3. | |
// https://github.com/zurb/foundation/blob/f755d8704123f86c281ede0b171881e2672f150d/scss/foundation/components/_block-grid.scss | |
// Original LESS Version by Christopher Mitchell (https://gist.github.com/ChrisTM) | |
// Converted to SCSS by Rasmus Jürs (https://github.com/Jursdotme) | |
[class*="block-grid-"] { | |
display: block; | |
margin: -($grid-gutter-width/2); | |
padding: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### RAILS 4.1 | |
# Doesn't work, due to the error: | |
# Asset filtered out and will not be served: add | |
# `Rails.application.config.assets.precompile += %w( refinery/refinery.css )` | |
# to `config/initializers/assets.rb` and restart your server | |
class MyEngine < Rails::Engine | |
# set the manifests and assets to be precompiled | |
initializer "refinery.assets.precompile" do |app| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AsyncTools | |
module Cleaners | |
def self.find_job_for_object_by_method(klass, method) | |
jobs = Sidekiq::ScheduledSet.new | |
jobs.select { |job| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PaymentService | |
VALID_CURRENCIES = Money::Currency.table.keys.map(&:upcase) | |
DEFAULT_CURRENCY = :EUR | |
APP_FEE = ->(amount) { amount * 15 / 100} | |
def initialize(user) | |
@user = user | |
@app_id = ENV['STRIPE_APP_ID'] | |
@app_secret = ENV['STRIPE_KEY'] | |
@client = OAuth2::Client.new(@app_id, @app_secret, site: 'https://connect.stripe.com') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def session_user | |
@session_user ||= if current_user.admin? && params[:user_id].present? | |
User.find(params[:user_id]) | |
else | |
current_user | |
end | |
end |