This file contains 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 IconicFontHelper | |
ICONIC_FONT_NAMES = { | |
hash: '#', | |
question_mark: '?', | |
at: '@', | |
pilcrow: '¶', | |
info: 'ℹ', | |
arrow_left: '←', | |
arrow_up: '↑', | |
arrow_right: '→', |
This file contains 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 ApplicationHelper | |
def audio_tag(source, options = {}) | |
options.symbolize_keys! | |
# originally defined as audio_path(source) but it doesn't work... | |
options[:src] = path_to_asset(source) | |
tag("audio", options) | |
end | |
end |
This file contains 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
# unicorn_rails -c /srv/myapp/current/config/unicorn.rb -E production -D | |
# | |
shared_dir = "#{ENV['DEPLOY_ROOT']}/shared" | |
deploy_name = ENV['DEPLOY_ROOT'].gsub(/^.+\//, '') | |
working_directory ENV['RAILS_ROOT'] | |
# worker_processes (rails_env == 'production' ? 10 : 4) | |
preload_app true | |
timeout 30 |
This file contains 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 Users::OmniauthCallbacksController < ApplicationController | |
def facebook | |
# You need to implement the method below in your model | |
@user = User.find_for_facebook_oauth(env["omniauth.auth"]) | |
if @user.persisted? | |
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook" | |
sign_in_and_redirect @user, :event => :authentication | |
else | |
session["devise.facebook_data"] = env["omniauth.auth"] |
This file contains 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 Users::SessionsController < Devise::SessionsController | |
def new | |
redirect_to '/users/auth/facebook' | |
end | |
end |
This file contains 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
#!/bin/sh | |
prefix='' | |
d=`date +%Y%m%d%H%M%S` | |
git flow release start $prefix-$d | |
git flow release finish -m"Release:$d" $prefix-$d |
This file contains 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
# GenericUtils | |
module GenericSupport | |
module Pathable | |
module ClassMethods | |
def path(hash, *pathes) | |
target = hash | |
pathes.map! do |p| | |
p.to_s.split(/[\/\.]+/) | |
end | |
pathes.flatten.each do |element| |
This file contains 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
a[target="_blank"]:after { | |
content: "\f08e"; | |
font-family: FontAwesome; | |
font-weight: normal; | |
font-style: normal; | |
display: inline-block; | |
text-decoration: inherit; | |
} |
This file contains 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 NonActiveRecordModel | |
include ActiveModel::Validations | |
include ActiveModel::Conversion | |
extend ActiveModel::Naming | |
def persisted?; false end | |
def initialize(hash = {}) | |
hash.each do |key, value| | |
m = "#{key}=" |
This file contains 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
{ | |
'image/bmp' => '.bmp', | |
'image/cgm' => '.cgm', | |
'image/gif' => '.gif', | |
'image/ief' => '.ief', | |
'image/jpeg' => '.jpg', | |
'image/png' => '.png', | |
'image/svg+xml' => '.svg', | |
'image/tiff' => '.tif', |