Skip to content

Instantly share code, notes, and snippets.

View nicerobot's full-sized avatar
๐Ÿค–
โ˜ฏ๏ธ โ˜ฎ๏ธ ๐Ÿถ ๐Ÿพ ๐Ÿ‘พ ๐ŸŽฎ ๐ŸŽผ ๐ŸŽถ ๐Ÿ•บ ๐ŸŽง ๐ŸŒป ๐ŸŒฑ ๐Ÿž ๐ŸŒŠ ๐ŸŒ” ๐ŸŒŽ

nicerobot

๐Ÿค–
โ˜ฏ๏ธ โ˜ฎ๏ธ ๐Ÿถ ๐Ÿพ ๐Ÿ‘พ ๐ŸŽฎ ๐ŸŽผ ๐ŸŽถ ๐Ÿ•บ ๐ŸŽง ๐ŸŒป ๐ŸŒฑ ๐Ÿž ๐ŸŒŠ ๐ŸŒ” ๐ŸŒŽ
View GitHub Profile
@nicerobot
nicerobot / Main.out
Last active October 11, 2015 20:10
Scala PartialFunction and Partially-applied functions
1. Success(0.2)
1. Failure(scala.MatchError: 0 (of class java.lang.Integer))
1. Failure(scala.MatchError: (of class java.lang.String))
2. Success(0.2)
2. Success(NaN)
2. Success(NaN)
3. Success(0.2)
3. Success(NaN)
3. Success(NaN)
@nicerobot
nicerobot / pgdump.sh
Created February 8, 2016 18:07
Backup a PostgreSQL database with each schema in a separate folder.
#!/bin/bash
export PGDATABASE=${PGDATABASE:-${1:-postgres}} PGUSER=${PGUSER:-${2:-postgres}} PGHOST=${PGHOST:-localhost}
echo '\dn' \
| psql -t \
| awk '/[a-z]/ && /etl/ && !/topology|tiger/ && !/_20/ && $1 != "public" {printf "%s\n",$1}' \
| while read n; do
echo ${n%%_*}
done \
@nicerobot
nicerobot / compose.go
Last active June 7, 2016 15:15
Go compose
package main
type R int
type F func(r R) R
//
func composer(f, g F) F {
if nil == g {
return f
} else if nil == f {
@nicerobot
nicerobot / funcE.go
Last active June 12, 2016 07:45
The versatility of Go errors
// Note: This is _just_ an example of the versatility of Go, or, more specifically, first-class functions and duck-typing.
package main
import "log"
type R string
type E func() string
// An example of a "catch" error function factory.
var Failure = func(message string, callback func()) error {
@nicerobot
nicerobot / Makefile
Last active August 7, 2016 16:42
ACS SeqNN.xls golang
.PHONY : build run
run: seq
./seq Seq99.xls 2>&1 | grep -B3 B24126_036
build: seq
seq: seq.go
go build -o $@
{
"geocoding": {
"version": "0.1",
"attribution": "https://search.mapzen.com/v1/attribution",
"query": {
"text": "135 san lorenzo ave, coral gables, fl 33146",
"parsed_text": {
"name": "135 san lorenzo ave",
"number": "135",
"street": "san lorenzo ave",
@nicerobot
nicerobot / async.go
Last active October 20, 2016 02:10
A fun little experiment to implement a sort of futures processing in Go.
// Basically, this allows independent chains of functions to all execute independently as goroutines
// while dependencies synchronously pass their results from one routine to the next.
// Surely this can be cleaned up. It was just a quick hack to toy with the concept.
// The main goal which I didn't even imlpement is to allow for the cancellation of branches.
package main
import (
"context"
"log"
"sync"
@nicerobot
nicerobot / .gitignore
Last active November 4, 2018 03:08
Docker daemon hangs opening (or writing) to fifo #911 https://github.com/docker/for-mac/issues/911
app
6461f4aa65877e88485c8a0b888a579c
package main
import (
"io"
"log"
"net"
"net/http"
"time"
)
@nicerobot
nicerobot / .gitignore
Last active January 12, 2017 02:40
Go questions
.idea/