Skip to content

Instantly share code, notes, and snippets.

View nax3t's full-sized avatar

Ian Schoonover nax3t

View GitHub Profile
@nax3t
nax3t / ranking.js
Created March 1, 2017 00:14
Reddit Ranking Algorithm in JavaScript
function _confidence(ups, downs) {
var n = ups + downs;
if(n === 0) {
return 0;
}
var z = 1.281551565545;
var p = parseFloat(ups) / n;
var left = p + 1 / (2 * n) * z * z;
@nax3t
nax3t / admoda-api
Last active August 29, 2015 14:18
Solution for Mike's API request
# My solution, using Typhoeus gem
p "-------Ian\'s Solution---------"
require 'typhoeus'
request = Typhoeus::Request.new("https://api.admoda.com/v1/advertiser/stats/campaigns.csv?date=2015-03-11",
method: :get,
headers: { 'Authorization' => 'Token api_token_here' })
response = request.run
puts response.body