This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// © 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this gist has been superseded by | |
// https://github.com/wookietreiber/scala-cli-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GIT_HOOK_DIR="$0.d" | |
if [[ -d $GIT_HOOK_DIR ]] ; then | |
while IFS= read -r -d $'\0' hook ; do | |
"./$hook" || error="yes" | |
done < <(find "$GIT_HOOK_DIR" -mindepth 1 -print0) | |
[[ -n $error ]] && exit 1 |
OlderNewer