Skip to content

Instantly share code, notes, and snippets.

View cbogart's full-sized avatar

Chris Bogart cbogart

View GitHub Profile
@cbogart
cbogart / timezone_sample.py
Created July 24, 2020 18:33
Moving a list of times forward a few months, taking into account daylight savings, and maybe a new timezone
import datetime
import pytz
# Note pytz is not standard python library, but there
# are no standard timezone classes before Python 3.2!!
# This is Python 2.7 code.
source_timezone = "America/New_York"
destination_timezone = "America/New_York"
# There are 2 kinds of dates:

Keybase proof

I hereby claim:

  • I am cbogart on github.
  • I am cbogart (https://keybase.io/cbogart) on keybase.
  • I have a public key whose fingerprint is B3EE 397D 4CEF 5C49 B6F9 7ADB E0F9 0FC7 011F D84B

To claim this, I am signing this object:

@cbogart
cbogart / json.gz.scanner.with.EventEmitter.js
Created October 18, 2015 02:11
Scan from many files, opening only one at a time.
var scangz = function (fname) {
var rawread = fs.createReadStream(fname);
var unzipped = rawread.pipe(zlib.createUnzip());
return unzipped;
}
var FileScanner = function() {
var self = this;
events.EventEmitter.call(self);
@cbogart
cbogart / json.gz.scanner.js
Created October 16, 2015 14:39
scans a list of gzipped json files looking for entries that match some filter
var zlib = require("zlib");
var jsonstream = require("json-stream");
var fs = require("fs");
var combine = require("combine-streams");
var Readable = require("stream").Readable;
var scangz = function (fname) {
var rawread = fs.createReadStream(fname);
var unzipped = rawread.pipe(zlib.createUnzip());
return unzipped;
# This is a test
Of putting gists in github
I hope you enjoyed it as much as I did.