Skip to content

Instantly share code, notes, and snippets.

View asauber's full-sized avatar
☁️

Andrew Sauber asauber

☁️
View GitHub Profile
/**
* Bead Ornaments - HackerRank Spring 2013 Hackathon
* Java bitmask DP solution
* Author: Jerry Ma (2013)
*
* Note that this solution uses BigInteger, which in some cases can add an unacceptable amount of overhead.
* This solution uses recursion with memoization to store the results for previously calculated states.
*/
import java.math.*;
@asauber
asauber / ds
Last active August 29, 2015 14:20 — forked from mlegenhausen/ds
#!/bin/sh
find $1 -type f -print0 | xargs -0 stat -f'%z' | awk '{b+=$1} END {print b}' | awk '{ sum=$1 ; hum[1024**3]="GB";hum[1024**2]="MB";hum[1024]="KB"; for (x=1024**3; x>=1024; x/=1024){ if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x];break } }}'
@asauber
asauber / new_events_observable.js
Last active March 8, 2018 02:34 — forked from rjstires/new_events_observable.js
new_events_observable.js
import * as Rx from 'rxjs/Rx';
import { API_ROOT } from 'src/constants';
import Axios, { AxiosResponse } from 'axios';
import * as moment from 'moment';
function createDatestamp() {
return moment().utc().format('YYYY-MM-DDTHH:mm:ss');
}
let datestamp = createDatestamp();