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
import Ember from 'ember'; | |
import Account from '../models/account'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
name: "", | |
balance: 0, | |
totalBalanceInCents: function() { | |
return this.model.reduce(function(previousValue, account) { |
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
require 'veritable' | |
API_KEY = ENV['VERITABLE_KEY'] | |
api = Veritable.connect(api_key: API_KEY) | |
rows = Veritable::Util.read_csv('klinkers-data.csv') | |
schema = { | |
'account' => {'type' => 'categorical'}, |
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
# Based on https://www.priorknowledge.com/docs/quickstart/python | |
require 'veritable' | |
API_KEY = ENV['VERITABLE_KEY'] | |
api = Veritable.connect(api_key: API_KEY) | |
rows = Veritable::Util.read_csv('bank-data.csv') |
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 BootstrapHelper | |
def icon_tag icon, opts = {} | |
defaults = { | |
white: false, | |
large: false | |
} | |
defaults.merge(opts) | |
class_string = "icon-#{icon.to_s}" | |
class_string = "#{class_string} icon-white" if defaults[:white] | |
class_string = "#{class_string} icon-large" if defaults[:large] |
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
#config/initializers/redis.rb | |
require 'redis' | |
require 'redis/objects' | |
REDIS_CONFIG = YAML.load( File.open( Rails.root.join("config/redis.yml") ) ).symbolize_keys | |
dflt = REDIS_CONFIG[:default].symbolize_keys | |
cnfg = dflt.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym] | |
$redis = Redis.new(cnfg) | |
Redis::Objects.redis = $redis |
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
# This is my take on a rails 3.1 setup with mongoid, rspec2, guard, spork | |
# and factory girl. | |
# | |
# Thanks to: | |
# http://gist.github.com/568754/ (inspiration) | |
# http://railscasts.com/episodes/275-how-i-test (rspec and guard) | |
# http://railscasts.com/episodes/285-spork (spork and guard) | |
# http://github.com/diaspora/diaspora (.rvmrc) | |
# http://stackoverflow.com/questions/7801073/spork-timer-not-resetting-between-runs | |
# and others... |