Skip to content

Instantly share code, notes, and snippets.

View jasonhargrove's full-sized avatar
🤖
hello world!

Jason jasonhargrove

🤖
hello world!
View GitHub Profile
@jasonhargrove
jasonhargrove / gist:fa12c4abb0ea03a3ca1ef3706a6347ed
Created October 21, 2016 14:19 — forked from ttezel/gist:4138642
Natural Language Processing Notes

#A Collection of NLP notes

##N-grams

###Calculating unigram probabilities:

P( wi ) = count ( wi ) ) / count ( total number of words )

In english..

@jasonhargrove
jasonhargrove / await.js
Last active July 23, 2016 19:55
ES7 async function, await and setTimeout
export async function test () {
let some = await someThing(3000);
console.log(some);
return some;
}
async function someThing (ms) {
return new Promise(resolve => setTimeout(() => {
resolve(ms)
@jasonhargrove
jasonhargrove / gist:4eef30f3fcf3457db5ac
Last active August 29, 2015 14:20
Twitter Media Upload using Node OAuth
// there are proprietary objects here not included in this unpolished snippet
// but you should get the gist
var OAuth = require('oauth');
var oauth = new OAuth.OAuth(
'https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
consumer_key,
consumer_secret,