$ rails g model User
belongs_to
has_one
#Mac OS X
<?php | |
error_reporting(E_ALL); | |
define('NUM_FEATURES', 3); | |
// My dataset describes cities around the world where I might consider living. | |
// Each sample (city) consists of 3 features: | |
// * Feature 1: average low winter temperature in the city | |
// * Feature 2: city population, in millions |
Unofficial documentation to internal Riot Games APIs for LOL eSports.
// Playground - noun: a place where people can play | |
import Foundation | |
extension NSTimeInterval { | |
var seconds: NSTimeInterval { | |
return self | |
} | |
var minutes: NSTimeInterval { |
# Margins of Safety | |
# 30% > $ 10B | |
# 50% - 30% for $1-10B Market Cap | |
# > 50% for < $1B | |
# Owner's Earnings | |
# Read more: http://www.oldschoolvalue.com/blog/valuation-methods/working-capital-free-cash-flow-fcf/#ixzz3O1Egljwo | |
# Owner earnings = Net income + depreciation & amortization +/- one-time items +/- changes in working capital - capital expenditures | |
def owner_earnings # Better than free cash flow |
class IsinValidator < ActiveModel::Validator | |
CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
def validate(record) | |
value = record[:isin_cusip] | |
return if value.blank? | |
digits = value.upcase.chars.collect { |c| CHARS.index c } | |
digits = digits.join.chars.collect { |c| c.to_i } | |
actual_check_digit = digits.pop |
module ArelHelpers | |
extend self | |
def self.included(base) | |
base.extend self | |
end | |
def asterisk(arel_table_or_model) | |
arel_table, columns = case arel_table_or_model | |
when Arel::Table |
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>