Skip to content

Instantly share code, notes, and snippets.

blake@Blake-Smiths-MacBook-Pro:~/src/ghc » ./configure --target=arm-linux-gnueabihf --enable-unregisterised
checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for GHC version date... inferred 7.7.20131029
checking for ghc... /usr/bin/ghc
checking version of ghc... 7.4.2
checking build system type... x86_64-apple-darwin12.5.0
checking host system type... x86_64-apple-darwin12.5.0
checking target system type... arm-unknown-linux-gnueabihf
@blakesmith
blakesmith / gist:5234714
Created March 25, 2013 03:21
After a fresh install of Haskell Platform, there's a bunch of broken packages. Normal?
blake@Blake-Smiths-MacBook-Pro:~ » ghc-pkg check
Warning: haddock-interfaces: /usr/local/Cellar/haskell-platform/2012.2.0.0/share/doc/haskell-platform-2012.2.0.0/html/haskell-platform.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/local/Cellar/haskell-platform/2012.2.0.0/share/doc/haskell-platform-2012.2.0.0/html doesn't exist or isn't a directory
There are problems in package zlib-0.5.3.3:
Warning: library-dirs: /usr/local/Cellar/haskell-platform/2012.2.0.0/lib/ghc/zlib-0.5.3.3/ghc-7.4.2 doesn't exist or isn't a directory
Warning: haddock-interfaces: /usr/local/Cellar/haskell-platform/2012.2.0.0/share/doc/zlib-0.5.3.3/html/zlib.haddock doesn't exist or isn't a file
Warning: haddock-html: /usr/local/Cellar/haskell-platform/2012.2.0.0/share/doc/zlib-0.5.3.3/html doesn't exist or isn't a directory
import-dirs: /usr/local/Cellar/haskell-platform/2012.2.0.0/lib/ghc/zlib-0.5.3.3/ghc-7.4.2 doesn't exist or isn't a directory
file Codec/Compression/GZip.hi is missing
file Codec/Compress
@blakesmith
blakesmith / pgmigrations.erb.sh
Created January 25, 2013 01:01
Create numbered migration files, 1-create_users.sql, 2-create_accounts.sql, put them in the MIGRATIONS_LOCATION directory.
#!/bin/bash
export PGPASSWORD=<%= password %>
USER=<%= user %>
DATABASE=<%= database %>
HOST=<%= host %>
MIGRATIONS_TABLE=<%= migrations_table %>
MIGRATIONS_LOCATION=<%= migrations_location %>
Do What You Want
Those are the most frightening four words brought to us by the connection revolution.
If you want to sing, sing.
If you want to lead, lead.
If you want to touch, connect, describe, disrupt, give, support, build, question... do it.
You will not be picked.
But if you want to pick yourself, go for it.
The cost is that you own the results
package main
import (
"fmt"
"time"
)
func intervalMessage(msg string, dur time.Duration) chan string {
outc := make(chan string)
go func() {
package main
import (
"bytes"
"code.google.com/p/go.net/websocket"
"crypto/sha1"
"fmt"
"image/gif"
"image/png"
"io"
[root@host bsmith]# traffic_line -r proxy.config.cache.ram_cache.size
32212254720
[root@host bsmith]# traffic_line -r proxy.process.cache.bytes_total
0
[root@host bsmith]# traffic_shell
Successfully Initialized MgmtAPI in /var/trafficserver/trafficserver
% trafficserver> show:cache-stats
Bytes Used --- 0 GB
Cache Size --- 0 GB
@blakesmith
blakesmith / grok_test.c
Created August 26, 2012 23:53
Simple Grok test. Compile with: gcc grok_test.c -Wall -lgrok -o grok_test
USERNAME [a-zA-Z0-9_-]+
USER %{USERNAME}
INT (?:[+-]?(?:[0-9]+))
BASE10NUM (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))
NUMBER (?:%{BASE10NUM})
BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+))
BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b
POSINT \b(?:[0-9]+)\b
WORD \b\w+\b
package main
import (
"net/http"
"log"
"io/ioutil"
"fmt"
)
func main() {
@blakesmith
blakesmith / gist:3051584
Created July 5, 2012 05:44
Go Tour: Exercise: Exercise: Fibonacci closure - My solution
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
a := 0
b := 1
f := func() int {