Skip to content

Instantly share code, notes, and snippets.

View dln's full-sized avatar
🚀

Daniel Lundin dln

🚀
View GitHub Profile
@dln
dln / jellohack.c
Created June 2, 2014 20:50
Hack for xscreensaver I did a long time ago.
/* A screen saver hack to display the CodeFactory logotype
* in a jiggling fashion with a lil bit o bounce... *grin*
*
* Daniel Lundin <[email protected]>
*
* Copyright 2001 Seven relatively short dudes and a pale chick
*
* This software is released under Disgruntled Catholic License v6.66
* Redistribution prohibited without authorization from the pope.
* Under special circumstances under which should such authorization
To get started with Docker/Marathon/Mesos, you need to install a
new Mesos, a new Marathon, and Deimos, the bridge to Docker.
You'll also need Docker and the JVM. These instructions are for
Ubuntu 13.10.
## Install Mesos prerequisites
:; sudo apt-get update
:; sudo apt-get install zookeeperd default-jre python-setuptools python-protobuf curl pip
## Install recent Mesos
@massie
massie / KryoRegistrator.scala
Created October 29, 2013 23:59
Here's an example of how to embed Avro objects into a Kryo stream. You only need to register each Avro Specific class in the KryoRegistrator using the AvroSerializer class below and you're ready to go.
/*
* Copyright (c) 2013. Regents of the University of California
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@non
non / infset.scala
Last active December 22, 2015 04:18
Examples of non-container set implementations for Scala.
package spire.examples
import spire.algebra._
import spire.math.{Natural, UInt}
import scala.collection.mutable
object SetUtil {
def powerStream[A](members: Stream[A]): Stream[Set[A]] = {
val done = Stream.empty[Set[A]]
@icub3d
icub3d / main.go
Created July 29, 2013 23:46
First stab at groupcache.
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"github.com/golang/groupcache"
"io"
"net"
#!/bin/sh
set -e
log() {
str="alpbs: $1\n"
shift
printf "$str" "$@" >&2
}
package com.mansur.scalding
import com.twitter.scalding._
import org.apache.lucene.search.spell._
import org.apache.mahout.common.distance.TanimotoDistanceMeasure
import org.apache.mahout.math.DenseVector
import org.apache.commons.math.util.MathUtils
/**
@phobos182
phobos182 / kafka_consumer.py
Created October 22, 2012 15:07
Kafka Graphite Consumer
#!/usr/bin/env python
from optparse import OptionParser
from brod.zk import *
import pickle
import struct
import socket
import sys
import time

Don't use MongoDB

I've kept quiet for awhile for various political reasons, but I now feel a kind of social responsibility to deter people from banking their business on MongoDB.

Our team did serious load on MongoDB on a large (10s of millions of users, high profile company) userbase, expecting, from early good experiences, that the long-term scalability benefits touted by 10gen

@dln
dln / inotify-cmake.sh
Created July 17, 2012 10:36
Continuous build on the cheap, using inotify, cmake and a terminal
#!/bin/bash
# Watch paths (given as arguments), automatically build when something changes.
# The script does a couple opinionated things to make my life easier:
#
# * Terminal scrollbuffer is reset before each iteration, simplifying scrolling.
# * I use a filter script to colorize gcc output (clang errors would be nicer).
# * Output is copied to a log file (/tmp/build.log).
# - I open this file in Sublime or vim, which reloads the file on change (each build).
#
# Usage: