Skip to content

Instantly share code, notes, and snippets.

View araddon's full-sized avatar

Aaron Raddon araddon

  • Portland, OR
View GitHub Profile
package main
import (
"bytes"
"encoding/json"
"flag"
"io/ioutil"
"log"
"math/rand"
"net/http"
@araddon
araddon / main.go
Last active August 29, 2015 14:21
forestdb
package main
import (
"fmt"
u "github.com/araddon/gou"
forestdb "github.com/couchbaselabs/goforestdb"
)
func main() {
u.SetupLogging("debug")
@araddon
araddon / syncthing.conf
Last active August 29, 2015 14:16
syncthing
description "Syncthing P2P sync service"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]
env STNORESTART=yes
env HOME=/home/aaron
setuid "aaron"
setgid "aaron"
@araddon
araddon / btsync.sh
Last active August 29, 2015 14:15
btsync
#!/bin/bash
#
# v 0.03
cd /tmp
rm -f btsync.tar.gz
wget https://download-cdn.getsyncapp.com/stable/linux-x64/BitTorrent-Sync_x64.tar.gz -O btsync.tar.gz
@araddon
araddon / btsync.sh
Last active August 29, 2015 14:12
install bit torrent sync
#!/bin/bash
#
# v 0.02
cd /tmp
rm -f btsync.tar.gz
# wget http://download-new.utorrent.com/endpoint/btsync/os/linux-x64/track/stable -O btsync.tar.gz
wget http://usyncapp.com/2.0.30/bittorrent-sync_x64.tar.gz -O btsync.tar.gz
@araddon
araddon / semaphore.go
Created May 25, 2014 19:09
limited size bg queue
// from
// https://github.com/sbhackerspace/sbhx-boardinator/blob/0b210dd088502ff2a55453897601ef2361679514/types/email.go#L65
func StartEmailQueue() {
var semaphore = make(chan bool, 10) // Can only send 10 at once
go func() {
for {
email := <-EmailQueue
email.Status = QUEUED
@araddon
araddon / tag_pagedata.html
Last active January 3, 2016 14:39
page level data for all events
window.jstag=function(){var t={_q:[],_c:{},ts:(new Date).getTime()},l=false,w=window,d=document,src="/static/io",as=Array.prototype.slice,sp;t.init=function(c){sp=c.js?c.js:c.url||"";c.ext=c.ext||".min.js";t._c=c;return this};t.load=function(){var js,fjs=d.getElementsByTagName("script")[0];l=true;if(d.getElementById(src))return this;js=d.createElement("script");js.id=src;js.src=sp+src+t._c.ext;fjs.parentNode.insertBefore(js,fjs);return this};t.bind=function(e){this._q.push([e,as.call(arguments,1)])};t.ready=function(){this._q.push(["ready",as.call(arguments)])};t.send=function(){if(!l)this.load();this._q.push(["ready","send",as.call(arguments)]);return this};return t}();
jstag.init({cid:"CUSTOMER_ID",url:'//c.lytics.io',ext:".js"})
jstag.bind("send.before",function(o,io){
// will be sent on all events on this page
o.data["mystuff"] = 'here';
o.data["arrayofstuff"] = ["category1","category2"];
})
@araddon
araddon / gist:7035106
Last active December 25, 2015 20:29 — forked from schmichael/gist:7034672
@araddon
araddon / twoauth.go
Created July 2, 2013 23:46
Twitter Oauth Test
package main
import (
"flag"
"fmt"
oauth "github.com/akrennmair/goauth"
"io/ioutil"
)
/*
@araddon
araddon / main.go
Created May 22, 2013 03:14
Determine if a go process is running in a terminal, or not
package main
import (
"fmt"
"syscall"
"unsafe"
)
type winsize struct {
Row uint16