Skip to content

Instantly share code, notes, and snippets.

View DerDackel's full-sized avatar

Sebastian Jackel DerDackel

  • codecentric AG
  • Near Frankfurt, Germany
View GitHub Profile

Keybase proof

I hereby claim:

  • I am derdackel on github.
  • I am der_dackel (https://keybase.io/der_dackel) on keybase.
  • I have a public key ASCfD1OTF4Xx-9FWNs_92eqBxeMnjzmPsgBENNktRkQf3wo

To claim this, I am signing this object:

@DerDackel
DerDackel / gist:7142826
Created October 24, 2013 18:47
Lovecraft SOI Kapitel 3 Freimaurerkommende
Un' genau dann hatten unsere Leute den Esoterischen Orden des Dagon organisiert un' die Freimaurerhalle von der Golgota-Kommende dafür gekauft...
import java.util.concurrent.atomic.AtomicBoolean;
public class ToggleBoolean {
public static void getAndToggle(AtomicBoolean a) {
for (;;) {
boolean current = a.get();
if (a.compareAndSet(current, !current)) {
return current;
}
@DerDackel
DerDackel / gist:1364983
Created November 14, 2011 20:06 — forked from hukl/gist:1364952
Ruby vs Erlang building URL query params for a GET request
//Scala:
//-----------------------------------------------------------------
val params = Map(
'foo -> "bar",
'baz -> "bang"
)
//pretty prints
println(params mkString " & ") // 'foo -> bar & 'baz -> bang
@DerDackel
DerDackel / gist:1114090
Created July 29, 2011 15:48 — forked from dcsobral/gist:1112401
Faster char split
// Since this link got passed around some, I'm going to paste here the
// versions made by sirthias. If you want to see the old ones,
// look up the history.
// Well, actually, these are non-pimped versions. See the comments to
// a link where they are provided as pimped methods on String.
import scala.annotation.tailrec
def fastSplit(s: String, delimiter: Char): List[String] = {