Keybase proof
I hereby claim:
- I am joshcutler on github.
- I am josh_cutler (https://keybase.io/josh_cutler) on keybase.
- I have a public key ASCSrd4wWnjKO-7mDK2oifqvcHYZvYvnroCGAmbVZJ9G_Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
if typeof(Object.create) != 'function' | |
Object.create = (o) -> | |
F = () -> { } | |
F.prototype = o | |
return new F() | |
fromPrototype = (prototype, object) -> | |
newObject = Object.create(prototype) | |
`for(prop in object) | |
{ |
(subject:(Theory) arendt OR rawls -micro -microeconomic -to:cs-econ) |
.gist .highlight { | |
border-left: 3ex solid #eee; | |
position: relative; | |
} | |
.gist .highlight pre { | |
counter-reset: linenumbers; | |
} | |
.gist .highlight pre div:before { |
sudo -u postgres createuser <username> |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
perl -ne 'print if (rand() < .01)' large_input_file.txt > sampled_output.txt |
require('Rook') | |
library(Rook) | |
library(rjson) | |
rook = Rhttpd$new() | |
rook$add( | |
name ="summarize", | |
app = function(env) { | |
req = Rook::Request$new(env) |
mkdir rookonheroku | |
cd rookonheroku | |
mkdir bin | |
echo "puts 'OK'" > config.ru | |
echo "source 'http://rubygems.org'\n gem 'rack'" > Gemfile | |
bundle install | |
git init . | |
git add . |
require 'classyfier' | |
@classyfier = Classyfier::NaiveBayes::NaiveBayesClassifier.new | |
@classyfier.train({:subject => 'Must read!', :text => 'Get Viagra cheap!'}, :spam) | |
@classyfier.train({:subject => 'Gotta see this', :text => 'Viagra. You can get it at cut rates'}, :spam) | |
@classyfier.train({:subject => 'Call me tomorrow', :text => 'We need to talk about scheduling. Call me.'}, :not_spam) | |
@classyfier.train({:subject => 'That was hilarious', :text => 'Just saw that link you sent me'}, :not_spam) | |
@classyfier.train({:subject => 'dinner at 7', :text => 'I got us a reservation tomorrow at 7'}, :not_spam) | |
@scores = @classyfier.classify({:subject => 'See it to believe it', :text => 'Best rates you\'ll see'}) |