Skip to content

Instantly share code, notes, and snippets.

@havocp
havocp / gist:2177fc9fc3aaa03860b6
Created November 12, 2015 13:05
2015-11-12 8am output of bokeh coffee/python comparison test
AjaxDataSource: coffee is missing some properties found in Python
AjaxDataSource.callback: python defaults to null but coffee has no such property
AjaxDataSource.column_names: python defaults to [] but coffee has no such property
AjaxDataSource.data_url: python defaults to null but coffee has no such property
AjaxDataSource.if_modified: python defaults to false but coffee has no such property
AjaxDataSource.max_size: python defaults to null but coffee has no such property
AjaxDataSource.method: python defaults to "POST" but coffee has no such property
AjaxDataSource.name: python defaults to null but coffee has no such property
AjaxDataSource.polling_interval: python defaults to null but coffee has no such property
AjaxDataSource.session: python defaults to null but coffee has no such property
@havocp
havocp / mockup-viewer.py
Created July 1, 2015 13:27
pygtk app to extract pixel sizes and colors from mockups
#! /usr/bin/python
# this script is Copyright 2006, Red Hat, Inc. Licensed under the GNU
# General Public License, version 2 or any later version.
import gtk
import sys
import cairo
import struct
@havocp
havocp / gist:3b4866ea03e4545a7e2a
Created September 25, 2014 23:56
CanLoadSimpleProject failure
This file has been truncated, but you can view the full file.
Using worker: worker-linux-12-1.bb.travis-ci.org:travis-linux-14
travis_fold:start:git.1
travis_time:start:15381587
$ git clone --depth=50 git://github.com/sbt/sbt-remote-control.git sbt/sbt-remote-control
Cloning into 'sbt/sbt-remote-control'...
remote: Counting objects: 3100, done.
remote: Compressing objects: 0% (1/1066) 
remote: Compressing objects: 1% (11/1066) 
remote: Compressing objects: 2% (22/1066) 
@havocp
havocp / gist:7048451
Last active December 25, 2015 22:19
Type safety in real life

My mom is building a house. The builder sent her an invoice spreadsheet, which was simply a bunch of items summed up:

  $5000.00
   $100.00
  $1300.00
   ... etc.

GRAND TOTAL $WHATEVER
@havocp
havocp / RipMusic.sh
Created March 3, 2013 18:56
My hacky rip script
#!/bin/bash
set -e
function die() {
echo "$*" 1>&2
exit 1
}
SKIP_RIP=0
@havocp
havocp / BatchingExecutionContext.scala
Created July 12, 2012 13:08
BatchingExecutionContext
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scala.concurrent.impl
@havocp
havocp / example-akka-filtering.patch
Created June 5, 2012 22:15
example of filtering mima issues
diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala
index 23d51fe..a47aa8e 100644
--- a/project/AkkaBuild.scala
+++ b/project/AkkaBuild.scala
@@ -13,6 +13,7 @@ import com.typesafe.sbtscalariform.ScalariformPlugin.ScalariformKeys
import com.typesafe.sbtosgi.OsgiPlugin.{ OsgiKeys, osgiSettings }
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact
+import com.typesafe.tools.mima.plugin.MimaKeys.binaryIssueFilters
import java.lang.Boolean.getBoolean
@havocp
havocp / filter-reported-issues.patch
Created June 5, 2012 22:15
Patch to support filtering mima issues
diff --git a/core/src/main/scala/com/typesafe/tools/mima/core/Filters.scala b/core/src/main/scala/com/typesafe/tools/mima/core/Filters.scala
new file mode 100644
index 0000000..fc8b98c
--- /dev/null
+++ b/core/src/main/scala/com/typesafe/tools/mima/core/Filters.scala
@@ -0,0 +1,17 @@
+package com.typesafe.tools.mima.core
+
+object ProblemFilters {
+
@havocp
havocp / null-actor-instance.patch
Created May 30, 2012 23:32
some ActorCell hacking
diff --git a/akka-actor-tests/src/test/scala/akka/actor/HotSwapSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/HotSwapSpec.scala
index 120caa3..00ef54e 100644
--- a/akka-actor-tests/src/test/scala/akka/actor/HotSwapSpec.scala
+++ b/akka-actor-tests/src/test/scala/akka/actor/HotSwapSpec.scala
@@ -5,6 +5,7 @@
package akka.actor
import akka.testkit._
+import akka.util.duration._
@havocp
havocp / actor-cell-mid-construction.patch
Created May 29, 2012 04:38
set the 'actor' field in ActorCell mid-actor-construction rather than post-construction
diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala
index f268b8f..2db8956 100644
--- a/akka-actor/src/main/scala/akka/actor/Actor.scala
+++ b/akka-actor/src/main/scala/akka/actor/Actor.scala
@@ -304,6 +304,10 @@ trait Actor {
*/
implicit final val self = context.self //MUST BE A VAL, TRUST ME
+ // this will call back to receive and aroundReceive so do it
+ // only after we set up `context` and `self`