Skip to content

Instantly share code, notes, and snippets.

@danboykis
danboykis / gist:925249
Created April 18, 2011 12:41
FutureTask.cancel
import org.junit.Test;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
public class StopTest {
private final static ExecutorService es = Executors.newFixedThreadPool(10);
@Test
diff --git a/Library/Formula/gpg-agent.rb b/Library/Formula/gpg-agent.rb
index e620bf9..3d8a0e9 100644
--- a/Library/Formula/gpg-agent.rb
+++ b/Library/Formula/gpg-agent.rb
@@ -22,7 +22,8 @@ class GpgAgent < Formula
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
- "--enable-agent-only"
+ "--enable-agent-only",
import com.github.krukow.clj_ds.PersistentMap;
import com.github.krukow.clj_ds.Persistents;
import org.junit.Test;
import org.junit.Ignore;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
@danboykis
danboykis / file_size_rolling_appender.clj
Created July 25, 2017 16:10
a size based rolling appender
(ns example.file-size-rolling-appender
"Rolling file appender."
(:require [clojure.java.io :as io]
[taoensso.timbre :as timbre])
(:import [java.io File]
[java.text SimpleDateFormat]))
;; TODO Test port to Timbre v4
(defn- rename-old-create-new-log [^File log ^File old-log]
[includeIf "gitdir:~/projects/work/"]
path = ~/.work/.gitconfig
[includeIf "gitdir:~/personal/"]
path = ~/.personal/.gitconfig
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
rco = "!f() { REGEX=$1; shift; git checkout \"$@\" \"$(git branch --all | cut -c 3- | sed 's|^remotes/.*/||' | grep -m 1 -iEe \"$REGEX\" )\"; }; f"
import sys
import binascii
const_pool_tags = {7: 'CONSTANT_Class',
9: 'CONSTANT_Fieldref',
10: 'CONSTANT_Methodref',
11: 'CONSTANT_InterfaceMethodref',
8: 'CONSTANT_String',
3: 'CONSTANT_Integer',
4: 'CONSTANT_Float',