Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Status: Hood

George georgeu2000

💭
Status: Hood
View GitHub Profile
View JS Grid to JSON.js
function headerValues(){
return $( '#jsGrid' ).data( 'JSGrid' )
.fields
.filter( function( d ){
return d.name != '';
})
.map( function( d ){
return d.name
})
}
@georgeu2000
georgeu2000 / gist:034a8de58402ac33436aa1c967f4eac7
Created Jul 13, 2016
How to connect to Postgres DB with Active Record without Rails
View gist:034a8de58402ac33436aa1c967f4eac7
db_config = YAML.load( ERB.new( File.read( "config/postgres.yml" )).result )
ActiveRecord::Base.establish_connection( db_config[ ENV[ 'RACK_ENV' ]])
@georgeu2000
georgeu2000 / Data
Last active Aug 29, 2015
Data for Correlation
View Data
Decile Independent Variable Dependent Variable
1 -6.363525939 0.02950219728
2 -3.620811845 -0.5916029083
3 -2.119305936 0.5039044438
4 -0.7828944705 -0.07579965689
5 0.5483736073 0.642124125
6 1.765507323 1.193357292
7 2.966217647 0.727289107
8 4.186309079 1.433569839
9 5.77593317 0.06166535553
View roman_numeral.rb
class RomanNumeral
def self.to_arabic roman_number
add_roman roman_number
end
private
def self.add_roman roman_number
View gist:5007171
class RomanNumeral
def self.add_roman(roman_number)
result = 0
roman_number.each_char do |c|
result += roman_lookup(c)
end