Skip to content

Instantly share code, notes, and snippets.

View nesv's full-sized avatar

Nick Saika nesv

View GitHub Profile
@nesv
nesv / brew install -v clisp
Created February 21, 2012 16:06
clisp install - 20120221 11:06 GMT-5:00
==> Downloading http://ftpmirror.gnu.org/clisp/release/2.49/clisp-2.49.tar.bz2
File already downloaded in /Users/nsaika/Library/Caches/Homebrew
/usr/bin/tar xf /Users/nsaika/Library/Caches/Homebrew/clisp-2.49.tar.bz2
==> Downloading patches
/usr/bin/curl -qf#LA Homebrew 0.8.1 (Ruby 1.8.7-249; Mac OS X 10.7.3) https://trac.macports.org/export/89054/trunk/dports/lang/clisp/files/patch-src_lispbibl_d.diff -o 001-homebrew.diff --silent
==> Patching
/usr/bin/patch -f -p0 -i 001-homebrew.diff
patching file src/lispbibl.d
==> ./configure --prefix=/usr/local/Cellar/clisp/2.49 --with-readline=yes
./configure --prefix=/usr/local/Cellar/clisp/2.49 --with-readline=yes
@nesv
nesv / signals.go
Created October 3, 2012 02:26
Mainloop for Go apps that catch OS signals
import (
"log"
"os"
"os/signal"
"syscall"
)
var (
SystemSignals = make(chan os.Signal)
)
@nesv
nesv / which.go
Created December 6, 2012 03:52
which(1) implemented in Go
package main
import (
"flag"
"os"
"path"
"strings"
)
func main() {
@nesv
nesv / work.go
Created February 25, 2014 22:38
package main
import "time"
type WorkRequest struct {
Name string
Delay time.Duration
}
@nesv
nesv / collector.go
Last active December 6, 2018 17:46
package main
import (
"fmt"
"net/http"
"time"
)
// A buffered channel that we can send work requests on.
var WorkQueue = make(chan WorkRequest, 100)
@nesv
nesv / worker.go
Last active April 12, 2018 11:59
package main
import (
"fmt"
"time"
)
// NewWorker creates, and returns a new Worker object. Its only argument
// is a channel that the worker can add itself to whenever it is done its
// work.
@nesv
nesv / dispatcher.go
Last active December 11, 2018 21:41
package main
import "fmt"
var WorkerQueue chan chan WorkRequest
func StartDispatcher(nworkers int) {
// First, initialize the channel we are going to but the workers' work channels into.
WorkerQueue = make(chan chan WorkRequest, nworkers)
@nesv
nesv / main.go
Last active April 12, 2018 11:59
package main
import (
"flag"
"fmt"
"net/http"
)
var (
NWorkers = flag.Int("n", 4, "The number of workers to start")
@nesv
nesv / dynect_example.go
Last active August 29, 2015 14:01
An example on how to use the go-dynect/dynect package
package main
import (
"log"
"strings"
"github.com/nesv/go-dynect/dynect"
)
func main() {
@nesv
nesv / keybase.md
Created September 17, 2014 21:21
keybase.md

Keybase proof

I hereby claim:

  • I am nesv on github.
  • I am nesv (https://keybase.io/nesv) on keybase.
  • I have a public key whose fingerprint is 392E 5F87 22FE 2CC3 5605 D4B6 77FA 3F86 5BAA E611

To claim this, I am signing this object: