Skip to content

Instantly share code, notes, and snippets.

View gdoteof's full-sized avatar

geoff golder gdoteof

  • vision.ai
  • Burlington, VT
View GitHub Profile
@gdoteof
gdoteof / Dockerfile
Created July 4, 2014 20:07
super simple data only docker
FROM busybox
VOLUME /path/to/resource
# assumes that there is a folder called resource that contains stuff in the same directory as the dockerfile
ADD resource /path/to/resource
- searchbox : little arduino thing that goes on your network that proxies through and for search requests to a network of other searchboxes.
- cryptographically authentic video :
- start with random key (current bitcoin blockheader?)-> rKey
- and N = 0,
loop on:
- generate public pair for (rKey + N) -> qr
- display within video capture QR code representation of qr
@gdoteof
gdoteof / gist:36c8ddf4650bb7c92a24
Last active August 29, 2015 14:02
get bash shell for latest built docker
LASTDOCKER=`docker ps -l | tail -n1 | awk {'print $1'}` && \
docker commit $LASTDOCKER recent && \
docker run -i -t recent /bin/bash

I mentioned the other day I was playing with yesod-websocket, and my method was taking some existing Handler functions and adding websocket "commands" that map to those requests, and updating the Angular app talking to Haskell backend to use websockets for those specific requests.

I was surprised to see >100% increase in request time for a GET request vs a websocket message.

It's not a perfect comparison since I am passing slightly different json and parsing it differently.

That being said, here is my attempt to succintly describe what is going on:

I have a function

import Prelude
import System.IO
import System.Process
import Control.Applicative
import Control.Monad.IO.Class
import Data.Monoid
import System.Environment
main :: IO ()
@gdoteof
gdoteof / huntwin.pl
Created March 21, 2014 18:33
wins at irc duck hunt in #burlington, but can't shoot after missing
use strict;
use warnings;
use Irssi;
our $VERSION = '1.00';
our %IRSSI = (
authors => 'gdoteof',
contact => 'dont',
name => 'huntwin',
@gdoteof
gdoteof / Gruntfile.js
Created November 20, 2013 07:19
tryinatest
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
@gdoteof
gdoteof / cracker.rb
Created November 11, 2013 00:20
bitcoin password cracker
#!/usr/bin/ruby -w
require 'rubygems'
require 'json'
passphrase = "x"
def permute(a0, a1)
result = []
a0.each do |element0|
@gdoteof
gdoteof / gist:7189561
Created October 28, 2013 00:22
Automatic five star rating for okcupid. this will just click 5 stars over and over forever.. adjust the 300 (in microseconds) to maike it go faster/slower
window.setInterval(function(){$(document.getElementById('stars').childElements()[4]).click()},300)
@gdoteof
gdoteof / gist:7112784
Created October 23, 2013 04:53
NHL TEAM STAT GETTER - http://www.nhl.com/ice/teamstats.htm - DIRECTIONS: open up FIREFOX. go to the website. copy all the code below. go to tools -> web developer -> web console. paste in all the code elow into the text box in the console that pops up
var tableToExcel = (function() {
var uri = 'data:application/vnd.ms-excel;base64,'
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
, base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
, format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
return function(table, name) {
if (!table.nodeType) table = document.getElementById(table)
var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
window.location.href = uri + base64(format(template, ctx))
}