Skip to content

Instantly share code, notes, and snippets.

History

For a long time I've been really impacted by the ease of use Cassandra and CockroachDB bring to operating a data store at scale. While these systems have very different tradeoffs what they have in common is how easy it is to deploy and operate a cluster. I have experience with them with cluster sizes in the dozens, hundreds, or even thousands of nodes and in comparison to some other clustered technologies they get you far pretty fast. They have sane defaults that provide scale and high availability to people that wouldn't always understand how to achieve it with more complex systems. People can get pretty far before they have to become experts. When you start needing more extreme usage you will need to become an expert of the system just like any other piece of infrastructure. But what I really love about these systems is it makes geo-aware data placement, GDPR concerns potentially simplified and data replication and movement a breeze most of the time.

Several years ago the great [Andy Gross](ht

@chadlung
chadlung / main.go
Last active June 2, 2016 07:21
Fixing a race condition with a mutex (trivial example)
package main
import (
"fmt"
"sync"
)
func main() {
finished := make(chan bool, 1)
@p4tin
p4tin / text_adv-part-1.go
Last active February 29, 2024 18:59
Writing a Text Adventure Game in Go - Part 1
package main
import (
"fmt"
"math/rand"
"time"
)
type Game struct {
Welcome string
/* require XLSX */
var XLSX = require('XLSX')
function datenum(v, date1904) {
if(date1904) v+=1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active May 11, 2024 03:22
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@schmichael
schmichael / gist:7379338
Created November 8, 2013 23:32
Transparently compress and upload a file in golang
package main
import (
"bufio"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@mytharcher
mytharcher / authorization.js
Created November 7, 2012 15:16
A demo testing HTTP 401 authorization on node.js
var approot = process.env.PWD;
var db = require(approot + '/lib/db');
var encrypt = require(approot + '/lib/encrypt');
exports = module.exports = function (req, res, next) {
console.log('processing authorization...');
var session = req.session;
@border
border / mgoExample.go
Created August 27, 2012 15:33
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {