Skip to content

Instantly share code, notes, and snippets.

View edouardswiac's full-sized avatar

Edward Swiac edouardswiac

View GitHub Profile
@edouardswiac
edouardswiac / resample.js
Created July 6, 2018 00:07
resample + fill timeseries
// requires momentjs and lodash
// our time precision
let timeUnit = 'minute'
// playground timeseries event
let now = moment().subtract(1, 'hour')
let dates = [
{x: moment(now).subtract(3,"minutes"), y: 2},
{x: moment(now).add(10,"minutes"), y: 18},
@edouardswiac
edouardswiac / robotstxt.scala
Created May 16, 2016 15:59
robots.txt parser in scala (not yet 100% complete)
package robotstxt
import java.io.{ByteArrayInputStream, InputStreamReader, BufferedReader}
import java.nio.charset.StandardCharsets
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
object Parser extends App {
description "upstart configuration for gunicorn"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /home/jamie/.virtualenvs/projectname/bin/gunicorn_django -c /home/jamie/code/projectname/gunicorn.py /home/jamie/code/projectname/settings/production.py
@edouardswiac
edouardswiac / date_util.erl
Created September 24, 2011 19:03 — forked from zaphar/date_util.erl
set of utility functions that wrap the calendar module and erlangs now() date() and time() functions
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.