Skip to content

Instantly share code, notes, and snippets.

@tux21b
tux21b / frame_test.go
Created July 16, 2014 20:11
stupid allocations...
//+build ignore
package gocql
import (
"fmt"
"io"
"io/ioutil"
"sync"
"testing"
#include <iostream>
#include <sstream>
class Rational
{
private:
int a;
int b;
public:
@tux21b
tux21b / banking1.go
Created September 14, 2011 15:03
Shared vs. Isolated Mutability
// Fictional accounting example #1 - "Shared Mutability"
package main
import (
"fmt"
"sync"
)
type Account struct {
id string
@tux21b
tux21b / smile.go
Created December 10, 2011 12:52
Go-Port of an old Plan9 snippet featuring smileys
package main
import (
"fmt"
"os"
"unsafe"
)
type ʘᴗʘ int32
type Θ_Θ struct{}
@tux21b
tux21b / id_rsa.pub
Created January 23, 2012 10:01
SSH Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxXRA2PXooQhMcqVJYBe4pjeGJyFdDLmV5LcxF8C/iSDAFhIEOxz8o/g6L7kuMPMd+UPiJwZNkUECsgrHJM0RUMa8rcePM5/nN9RxLfQWmI45RAf2pxTqyndeOGmWr2xkHvd3KQqskC9wyQSjDvajG+V28fvmG/AewtZNt0C+n+6KumqtAqCUw/c3Sol7IthVtngsLkyEbEYDmGBqATWclX4J6nfyFHIC2qL42HX4SU2rDXMloMEkneZA75rsSI57KpvzmQNl0RCb7YOrbwxMMRShWdXlmG53z1xMBVPCSuLl6q/bTataJxt2Z91ERyqqmx7Y2+0b0n0NYsZsmf+X/ christoph@tuxmobil
@tux21b
tux21b / chess
Created March 22, 2012 06:42
unicode rocks!
8 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7 ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
6 · · · · · · · ·
5 · · · · · · · ·
4 · · · · · · · ·
3 ♙ · · · · · · ·
2 · ♙ ♙ ♙ ♙ ♙ ♙ ♙
1 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
a b c d e f g h
package main
import (
"database/sql"
"fmt"
_ "github.com/bmizerany/pq"
"log"
)
func QueryMap(db *sql.DB, query string) (map[string]interface{}, error) {
#include <iostream>
#include <typeinfo>
struct Game;
struct Command
{
void execute(Game& game);
};
@tux21b
tux21b / tc08.in
Created June 2, 2012 08:30
Ganz gemeiner TC (Entwurf)
a b c d e f g h
8 . . r . . . . . 8
7 . . . . . . . . 7
6 . . . . . . . . 6
5 . . . k . . . . 5
4 . . . . . . . . 4
3 . . . . . N . r 3
2 . K . . . P . . 2
1 . . . . . . . q 1
a b c d e f g h
@tux21b
tux21b / CQL 3
Created August 26, 2012 19:47
LIMIT isn't working as expected...
DROP KEYSPACE gocql_wiki;
CREATE KEYSPACE gocql_wiki
WITH strategy_class = 'SimpleStrategy'
AND strategy_options:replication_factor = 1;
USE gocql_wiki;
CREATE TABLE page (
title varchar,