Skip to content

Instantly share code, notes, and snippets.

View fizzy33's full-sized avatar

Glen Marchesani fizzy33

View GitHub Profile
$ 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
@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>());
@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]) {
// =++=++=++= 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()
def s = new Singleton()
try {
log("--log-- started")
s.main()
} catch (e) {
log("--log-- " + throwableToString(e))
} finally {
16:38:44,156 | qtp1739106410-34 | /webapi/index.tropo | DEBUG | medx.webapi.Index | received from tropo
{
"session":{
"id":"89c5f45de96f8ac16aac3b57387423fb",
"accountId":"174268",
"timestamp":"2013-07-06T20:38:42.291Z",
"userType":"HUMAN",
"initialText":null,
"callId":"c9b15fab9e8195ca5d368faaecf2c77f",
"to":{
{
"tropo":[
{
"on":{
"next":"/webapi/response.tropo","event":"continue"
}
},{
"on":{
"next":"/webapi/response.tropo","event":"error"
}
object SourcecodeNameBug extends App {
val x1 = new Foo {}
val x2 = new Foo {}
abstract class Foo(implicit name: sourcecode.Name) {
override def toString = name.value
}
package a8.recipe
import java.io.{ByteArrayOutputStream, PrintWriter}
import m3.fs._
import m3.json.JsonToString
import m3.predef._
object Exec {
Error:scala: Error: assertion failed:
CurrentDrag(moveCancelable = move, dropCancelable = drop, keyCancelable = escapeKey, drag = <drag: error>, dragFn = dragFunction, previousEvent = de)
while compiling: /Users/glen/code/manna/sjs/src/main/scala/a8/scalajs/GlobalVars.scala
during phase: superaccessors
library version: version 2.12.2
compiler version: version 2.12.2
reconstructed args: -deprecation -feature -Xplugin:/Users/glen/.ivy2/cache/org.scala-js/scalajs-compiler_2.12.2/jars/scalajs-compiler_2.12.2-0.6.18.jar -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMach