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 dependencies | |
### | |
require.paths.unshift "#{__dirname}/lib/support/express-csrf/" | |
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/" | |
express = require 'express' | |
app = module.exports = express.createServer() | |
RedisStore = require 'connect-redis' |
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
require 'zeus/rails' | |
ROOT_PATH = File.expand_path(Dir.pwd) | |
ENV_PATH = File.expand_path('spec/dummy/config/environment', ROOT_PATH) | |
BOOT_PATH = File.expand_path('spec/dummy/config/boot', ROOT_PATH) | |
APP_PATH = File.expand_path('spec/dummy/config/application', ROOT_PATH) | |
ENGINE_ROOT = File.expand_path(Dir.pwd) | |
ENGINE_PATH = File.expand_path('lib/my_engine/engine', ENGINE_ROOT) | |
class CustomPlan < Zeus::Rails |
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 ApplicationController < ActionController::Base | |
before_filter :ensure_fresh_i18n | |
private | |
def ensure_fresh_i18n | |
I18n.backend.ensure_freshness! I18n.locale | |
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
def generate_authentication_token | |
loop do | |
token = Devise.friendly_token | |
hashed_token = BCrypt::Password.create(token) | |
update_attribute(:token_id, Devise.friendly_token) | |
final_token = "#{token_id}-#{token}" | |
break { token: final_token, hashed_token: hashed_token } unless User.where(authentication_token: hashed_token).first | |
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
import Ember from 'ember'; | |
import config from 'garaje/config/environment'; | |
// based on https://karl-sjogren.com/2015/08/05/lazy-loading-extra-scripts-in-ember/ | |
const LOADING = {}; | |
function scriptLoader(id, src, parent = 'head') { | |
let promise; |
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
git status --porcelain | grep -v "D " | cut -c4- | grep "\.rb\|rake" | xargs rubocop -a |