Skip to content

Instantly share code, notes, and snippets.

View samilton's full-sized avatar

Sam Hamilton samilton

  • 6th Media Event
  • New York, NY
View GitHub Profile
-- vim: tabstop=2 shiftwidth=2 expandtab
-- We almost always start by importing the wezterm module
local wezterm = require 'wezterm'
-- Define a lua table to hold _our_ module's functions
local module = {}
-- Returns a bool based on whether the host operating system's
-- appearance is light or dark.
function module.is_dark()
-- vim: tabstop=2 shiftwidth=2 expandtab
-- We almost always start by importing the wezterm module
local wezterm = require 'wezterm'
-- Define a lua table to hold _our_ module's functions
local module = {}
-- Returns a bool based on whether the host operating system's
-- appearance is light or dark.
function module.is_dark()
package main
import (
"flag"
"fmt"
"github.com/influxdb/influxdb/client"
"log"
"math/rand"
"net/url"
"os"
package main
import (
"flag"
"fmt"
"github.com/influxdb/influxdb/client"
"log"
"net/url"
"os"
"time"
#!/usr/bin/env ruby
require 'date'
require 'logger'
logger = Logger.new(STDOUT)
# Start of period we need to run for
d1 = Date.parse("2015-01-01")
# End of period, which is today
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
unless ARGV.count > 1
puts "Usage: json_diff.rb json_file_1.json json_file_2.json"
exit
end
def different?(a, b, bi_directional=true)
@samilton
samilton / README.md
Created November 14, 2012 15:00 — forked from scttnlsn/README.md
Pub/sub with MongoDB and Node.js

Pub/sub with MongoDB and Node.js

Setup:

$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
@samilton
samilton / exampleMustache.html
Created July 3, 2012 13:22
Loading a Template from an external file
<!--
in a stand alone file called projectView.mustache.html. Adding the mustache to the name is just being explicit about what you are dealing
with. It's not neccessary but I'm a big fan of describing what something is
-->
<script id="tmpl-statusView" type="text/template">
<dl>
<dt>Name</dt>
<dd>{{name}}</dd>
<dt>Role<dt>
package FixParser;
use 5.008008;
use strict;
use warnings;
require Exporter;
our @ISA = qw(Exporter);
file = File.open("<file>", "rb").read