Skip to content

Instantly share code, notes, and snippets.

View briansorahan's full-sized avatar
🎯
Focusing

Brian Sorahan briansorahan

🎯
Focusing
View GitHub Profile
@briansorahan
briansorahan / delete rax server
Last active August 29, 2015 14:21
attempt to delete rax server with ansible
- hosts: 127.0.0.1
connection: local
gather_facts: false
tasks:
- name: Destroy servers
rax: name=rax-ord-pub-01 image="Ubuntu 15.04 (Vivid Vervet) (PVHVM)" flavor=2 region="{{ rax_region | default('DFW') }}" state=absent
@briansorahan
briansorahan / path-problem.sh
Last active August 29, 2015 14:23
praxent pather
#!/bin/sh
cat <<PROB
Given that the text file 'input.txt' contains a rectangular block of dot
characters ('.') and two or more hash characters ('#'), write a program 'pather'
which writes out to 'output.txt' the same data with the two '#' characters
joined by asterisks ('*'). The command will be invoked like this:
pather input.txt output.txt
Your job is to implement 'pather' in this directory. This script will run it
@briansorahan
briansorahan / geometry.go
Last active August 29, 2015 14:27
golang geometry package
package geometry
import "math"
type Geom interface {
Area() float64
}
type circle float64
@briansorahan
briansorahan / go-precommit-hook.sh
Last active September 16, 2015 12:57
Setup a simple pre-commit hook for go projects
#!/bin/bash
add_precommit_hook() {
local dir=$1
local sample=$dir/pre-commit.sample
local file=${sample/%.sample/}
rm -f $sample
echo '#!/bin/bash' > $file
echo 'exec go test -race' >> $file
chmod +x $file
package main
// swagger:route GET /foo Gets all the foo.
//
// Gets all the foo.
//
// Produces:
// - application/json
//
// Schemes: http, https
@briansorahan
briansorahan / worker-pool.go
Created February 1, 2017 15:01
Go worker pool. Just toying with ideas.
package main
import (
"fmt"
"math/rand"
"time"
)
type StringsWorker struct {
Errors chan<- error
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@briansorahan
briansorahan / mp-patch.md
Last active January 4, 2018 04:04
Notes on diving into the vcvrack source code.

All modules will implement a stepStream method that is called in the realtime callback. Instead of processing a single sample at a time, they will process a block of samples.

How to pass the sample output of one module to the sample input of the next?

After initializing the stream in openStream we allocate a buffer of blockSize and let modules write into this as we traverse the graph.

@briansorahan
briansorahan / BogaudioCrashDarwin.md
Created January 18, 2018 21:45
Crash Report for Bogaudio VCV Rack Module
Process:               Rack [3633]
Path:                  /Applications/Rack.app/Contents/MacOS/Rack
Identifier:            com.vcvrack.rack
Version:               ??? (???)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Rack [3633]
User ID:               2064188898
@briansorahan
briansorahan / mktopic.go
Last active September 24, 2018 17:12
Testing github.com/segmentio/kafka-go CreateTopics method.
package main
import (
"fmt"
"io"
"log"
"os"
"github.com/pkg/errors"
sk "github.com/segmentio/kafka-go"