Skip to content

Instantly share code, notes, and snippets.

View dvillega's full-sized avatar

Devin Villegas dvillega

View GitHub Profile
@dvillega
dvillega / Timer.py
Created August 25, 2017 16:48 — forked from lucindo/Timer.py
import time
# Simple Timer
class Timer:
def __init__(self):
self.reset()
def reset(self):
self._start = time.time()
def elapsed(self): # elapsed time in seconds (float)
@dvillega
dvillega / stats.py
Created August 25, 2017 16:47 — forked from lucindo/stats.py
# Helper class for statistics
# see: http://www.johndcook.com/blog/standard_deviation/
class Stats:
""" Uses Welford's method to calculate stats.
Assumes positive values.
It's not thread safe
stats = Stats("ConnectionTimeStats")
stats.add(0.223)
stats.add(1.343)
ho
@dvillega
dvillega / 0_reuse_code.js
Created March 2, 2016 16:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am dvillega on github.
  • I am dvillega (https://keybase.io/dvillega) on keybase.
  • I have a public key whose fingerprint is 813C C62F 8B0F 9FCE C15C C555 110E 9C81 595C 23D6

To claim this, I am signing this object: