Skip to content

Instantly share code, notes, and snippets.

View the1mills's full-sized avatar

Denman the1mills

  • San Francisco, CA
View GitHub Profile
@the1mills
the1mills / gist.js
Last active November 25, 2018 06:23
Reducing each node in tree to branches representation
'use strict';
const animals = {
canines: {
dogs: {
poodle: {
val: true
}
@the1mills
the1mills / inner-classes.java
Last active November 17, 2018 02:08
inner vs outer private classes
package whatever;
class Outer2 {}
public class Outer {
class Inner2 {}
}
@the1mills
the1mills / ranker.js
Created November 16, 2015 23:25
Ranking algo for social media feed
// So this is the model I have now (in JavaScript):
var GRACE_PERIOD_MILLIS = 259200000; // 3 days worth of milliseconds
function getRanking(post) {
var millis = post.dateCreated.getTime(); //get milliseconds since post was first posted
var currentMillis = Date.now(); //get current milliseconds since epoch