Skip to content

Instantly share code, notes, and snippets.

From b00ab1a369c87e2cdcc29f178a337a20bf7fb07b Mon Sep 17 00:00:00 2001
From: Daniel Norberg <dano@spotify.com>
Date: Thu, 12 Jun 2014 19:55:42 -0400
Subject: [PATCH] fix building on macosx
---
pkg/libcontainer/namespaces/nsenter.go | 133 +--------------------------------
1 file changed, 2 insertions(+), 131 deletions(-)
diff --git a/pkg/libcontainer/namespaces/nsenter.go b/pkg/libcontainer/namespaces/nsenter.go
require "formula"
class Docker < Formula
homepage "http://docker.io"
url "https://github.com/dotcloud/docker.git", :tag => "v1.0.0"
option "without-completions", "Disable bash/zsh completions"
depends_on "go" => :build
➜ docker git:(master) git co v1.0.0
Note: checking out 'v1.0.0'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
$ git clone https://github.com/spotify/helios
Cloning into 'helios'...
remote: Counting objects: 1618, done.
remote: Compressing objects: 100% (771/771), done.
remote: Total 1618 (delta 629), reused 1202 (delta 458)
Receiving objects: 100% (1618/1618), 484.54 KiB | 0 bytes/s, done.
Resolving deltas: 100% (629/629), done.
Checking connectivity... done
$ cd helios
$ mvn clean package -DskipTests
01:53:23.823 WARN TemporaryJobs.java:272 - Exception processing file /tmp/junit5199216890486863256/helios-agents
java.nio.file.FileSystemException: /tmp/junit5199216890486863256/helios-agents: Is a directory
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[na:1.7.0_51]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.7.0_51]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.7.0_51]
at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177) ~[na:1.7.0_51]
at java.nio.channels.FileChannel.open(FileChannel.java:287) ~[na:1.7.0_51]
at java.nio.channels.FileChannel.open(FileChannel.java:334) ~[na:1.7.0_51]
at com.spotify.helios.testing.JobPrefixFile.tryFromExistingFile(JobPrefixFile.java:90) ~[classes/:na]
at com.spotify.helios.testing.TemporaryJobs.removeOldJobs(TemporaryJobs.java:238) [classes/:na]
#!/bin/bash
cat /etc/resolv.conf | boot2docker ssh "cat > /etc/resolv.conf"
Foobar foobar = new FoobarBuilder()
.someFooThing(17)
.aBarField("hello world")
.build();
String json = mapper.writeValueAsString(foobar);
out.println(json);
@danielnorberg
danielnorberg / gist:191de475a8a468b8b183
Last active August 29, 2015 14:08
Java 8 - AutoMatter - static builder() method
@AutoMatter
interface Foobar {
// ...
static FoobarBuilder builder() {
return new FoobarBuilder();
}
}
Full thread dump
"jersey-client-async-executor-27@6501" prio=5 tid=0x106 nid=NA waiting
java.lang.Thread.State: WAITING
at sun.misc.Unsafe.park(Unsafe.java:-1)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at org.apache.http.pool.PoolEntryFuture.await(PoolEntryFuture.java:133)
at org.apache.http.pool.AbstractConnPool.getPoolEntryBlocking(AbstractConnPool.java:282)
at org.apache.http.pool.AbstractConnPool.access$000(AbstractConnPool.java:64)
@danielnorberg
danielnorberg / remove-trailing-whitespace
Created December 30, 2010 21:23
A simple script to recursively remove trailing whitespace from Objective-C source code files in a directory.
#!/bin/bash
if [ $# -gt 0 ]; then
echo
echo Removing trailing whitespace in $1
echo
find $1 -type f -iname '*.[hm]' -exec gsed -i 's/[[:space:]]*$//' '{}' ';'
else
echo
echo Usage:
echo remove-trailing-whitespace [target-dir]