Skip to content

Instantly share code, notes, and snippets.

View wookietreiber's full-sized avatar
🎸

♫ Christian Krause ♫ wookietreiber

🎸
View GitHub Profile
#!/usr/bin/env r
# create input file with:
# $ find /path/to/dir -type f -printf '%s\n' | gzip > dir.file.sizes.gz
# start with:
# $ zcat dir.file.size.gz | fshist.r
# edit breaks to your needed sizes
# leave the breaks "0" and "2^50" for the edges
suppressMessages(library(stats))
@guyru
guyru / tarsum
Created April 23, 2016 17:38
A small utility to compute checksums on every file inside a tar archive.
#! /usr/bin/env python
# Copyright (C) 2008-2009 by Guy Rutenberg
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@paulp
paulp / valign.txt
Last active May 9, 2016 20:55
Realizing the benefits of vertical alignment.
To realize the benefits of vertical alignment:
- code must be *self-formatting*
- deltas must be *semantic*
Each is within reach today, with moderate effort:
- edit *virtual* files which continuously adapt
- store semantic actions in a parallel VCS
@wookietreiber
wookietreiber / meansd.c
Last active July 23, 2018 05:29
calculate mean and standard deviation from numbers in stdin
// this gist has been superseded by
// https://github.com/wookietreiber/scala-cli-tools

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
// Define the following traits and companion object
// It's in Rapture Core (https://github.com/propensive/rapture-core) if you don't want to
trait LowPriorityDefaultsTo { implicit def fallback[T, S]: DefaultsTo[T, S] = null }
object DefaultsTo extends LowPriorityDefaultsTo { implicit def defaultDefaultsTo[T]: DefaultsTo[T, T] = null }
trait DefaultsTo[T, S]
// Then, assuming we want to specify a default for a type class like `Namer`,
case class Namer[T](name: String)
@viktorklang
viktorklang / swingfutures.scala
Created April 19, 2012 17:58
Akka Futures in the Swing Event Dispatch Thread
// © 2012 Viktor Klang
import akka.dispatch.ExecutionContext
import javax.swing.SwingUtilities
import java.util.concurrent.Executor
//
object SwingExecutionContext {
implicit val swingExecutionContext: ExecutionContext = ExecutionContext.fromExecutor(new Executor {
def execute(command: Runnable): Unit = SwingUtilities invokeLater command