Skip to content

Instantly share code, notes, and snippets.

View dysinger's full-sized avatar
🏠
Working from home

Dysinger dysinger

🏠
Working from home
  • Independent
  • Nearby
View GitHub Profile
@dysinger
dysinger / AffineTime.hs
Last active August 18, 2016 02:26 — forked from ljsc/AffineTime.hs
Messing around with the haskell thyme package.
#!/usr/bin/env stack
-- stack --resolver lts-6 --install-ghc runghc --package lens --package thyme --package vector-space
import Data.Thyme hiding (seconds)
import Data.Thyme.Format.Human
import Data.AffineSpace
import Data.VectorSpace
seconds, minutes, hours, days, weeks :: Rational -> NominalDiffTime
seconds n = fromSeconds n
@dysinger
dysinger / gist:6613786
Last active December 23, 2015 09:19 — forked from mwilliams/gist:6613649
cabal update
cabal install Cabal
cabal install cabal-install
export PATH=./.cabal-sandbox/bin:~/.cabal/bin:$PATH
cd ~/path/to/my/project
cabal sandbox init
cabal install elm
cabal install elm-server
@dysinger
dysinger / configuring-archlinux-ami.sh
Created January 15, 2012 07:26 — forked from ELLIOTTCABLE/configuring-archlinux-ami.sh
Instructions for building an EC2 AMI for Arch Linux
#!/dev/null
# This 'script' is a set of instructions for preparing and bundling an Arch
# Linux AMI for Amazon's EC2. Bits are to be run on three different
# computers, and there is interaction required, so please follow along and
# run commands individually.
# PROTIP: THESE DON'T ACTUALLY WORK. That's why I'm pasting them here,
# attemping to get some input on what I'm doing wrong. When the instructions
# are ready for prime-time, I'll clean them up and post them to my blog. If
# you're really interested, watch for it there:
/*
smtpd.js is SMTP server written for node.js
MIT License
*/
var tcp = require('tcp');
var sys = require('sys');
@dysinger
dysinger / sha1.js
Created April 18, 2010 01:15 — forked from jed/sha1.js
/* adapted by Jed Schmidt for use as a node.js module.
* the following node.js adapter code is MIT-licensed.
*
* Example usage:
*
* var sha1 = require("sha1.js"), hash;
*
* my_sha1 = sha1.hex( data );
* my_hmac_sha1 = sha1.hex( key, data );
*
# Config for Nginx to act as a front-end for Riak
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc)
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_)
# Config is in /etc/nginx/sites-available/default or somewhere like that
# Set up load-balancing to send requests to all nodes in the Riak cluster
# Replace these IPs/ports with the locations of your Riak nodes
upstream riak_hosts {
server 127.0.0.1:8098;