Skip to content

Instantly share code, notes, and snippets.

Charl Matthee charl

Block or report user

Report or block charl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@charl
charl / main.go
Created Nov 12, 2014
go-sql-driver/mysql stalls on locked table access
View main.go
package main
import (
"database/sql"
"fmt"
"log"
_ "github.com/go-sql-driver/mysql"
)
@charl
charl / gist:c7cdc4f08aeec05e8eea
Created Aug 7, 2014
Etcd upstart script for process control
View gist:c7cdc4f08aeec05e8eea
description "A highly-available key value store for shared configuration and service discovery"
author "Charl Matthee <charl@89n.com>"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn
@charl
charl / ssdb.conf
Created Aug 7, 2014
SSDB upstart script for process management under Ubuntu
View ssdb.conf
description "SSDB - A fast NoSQL database alternative to Redis"
author "Charl Matthee <charl@89n.com>"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
@charl
charl / Script output
Created Feb 12, 2013
Encoding::UndefinedConversionError: "\xE3" from ASCII-8BIT to UTF-8
View Script output
$ jruby ./test.rb
SUCCESS
=======================================================================
Native: {"created_at"=>"Mon Feb 11 16:33:45 +0000 2013", "id"=>301006116974915600, "id_str"=>"301006116974915586", "text"=>"やっとここまできた: ひとりでやるRiak Advent Calendar 2012 day14 - Haskell Client - kuenishi's blog - http://t.co/QXFzD0Sn", "source"=>"<a href=\"http://sites.google.com/site/yorufukurou/\" rel=\"nofollow\">YoruFukurou</a>", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>nil, "in_reply_to_user_id_str"=>nil, "in_reply_to_screen_name"=>nil, "user"=>{"id"=>5576192, "id_str"=>"5576192", "name"=>"UENISHI Kota", "screen_name"=>"kuenishi", "location"=>"Tokyo, Japan", "description"=>"Just got senior: these tweets are my own; forever. WishList http://t.co/50iJIDzM", "url"=>"http://kuenishi.github.com/", "entities"=>{"url"=>{"urls"=>[{"url"=>"http://kuenishi.github.com/", "expanded_url"=>nil, "indices"=>[0, 27]}]}, "description"=>{"urls"=>[{"url"=>"http://
@charl
charl / gist:4500622
Created Jan 10, 2013
What is the most efficient way to filter documents with a similar structure to the one below based on the 'expanded_url' key's value. There are two more general questions here: * How do you filter documents based on a nested key(s)? * How do you filter documents based on the value of a key that resolves to an array of objects?
View gist:4500622
{
"created_at": "Tue, 01 Jan 2013 12:55:09 +0000",
"entities": {
"hashtags": [{
"text": "Clojure",
"indices": [39, 47]
}],
"urls": [{
"url": "http://t.co/ythjuG5U",
"expanded_url": "http://benchmarksgame.alioth.debian.org/u32/benchmark.php?test=all&lang=clojure&lang2=java",
@charl
charl / gist:1473622
Created Dec 13, 2011
OS X Lion HardwareGrowler crashes when woken up
View gist:1473622
Process: HardwareGrowler [258]
Path: /Applications/HardwareGrowler.app/Contents/MacOS/HardwareGrowler
Identifier: com.growl.hardwaregrowler
Version: 1.2.2 (1.2.2)
Code Type: X86-64 (Native)
Parent Process: launchd [205]
Date/Time: 2011-12-14 06:36:19.967 +1100
OS Version: Mac OS X 10.7.2 (11C74)
You can’t perform that action at this time.