Skip to content

Instantly share code, notes, and snippets.

View fizzy33's full-sized avatar

Glen Marchesani fizzy33

View GitHub Profile
def s = new Singleton()
try {
log("--log-- started")
s.main()
} catch (e) {
log("--log-- " + throwableToString(e))
} finally {
// =++=++=++= isolate.groovy =++=++=++=
void sendSignal(String sessionId, String signalName) {
def url = new URL("https://api.tropo.com/1.0/sessions/${sessionId}/signals?action=signal&value=${signalName}")
log("--log-- http get -- " + url)
def connection = url.openConnection()
def response = slurpStream(connection.getInputStream())
def statusCode = connection.getResponseCode()
@fizzy33
fizzy33 / unit tests
Created October 27, 2012 16:09
Chord's an ast for memoizing and reifying string ops
object Chord {
import Impl._
def ~(s: String): Chord = stringToChord(s)
implicit def stringToChord(s: String): Chord = ChordedString(s)
case class PimpedIterable[T](iter: Iterable[T]) {
@fizzy33
fizzy33 / gist:3628474
Created September 5, 2012 00:23
Show how quickly java.util collections break in a multi-threaded environment
package net.model3.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ShowMeThatCME {
static List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
$ brew install wget
==> Downloading http://ftpmirror.gnu.org/wget/wget-1.13.4.tar.bz2
Already downloaded: /Library/Caches/Homebrew/wget-1.13.4.tar.bz2
==> ./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable-iri
configure: configuring for GNU Wget 1.13.4
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no