Skip to content

Instantly share code, notes, and snippets.

@havocp
havocp / gist:2177fc9fc3aaa03860b6
Created Nov 12, 2015
2015-11-12 8am output of bokeh coffee/python comparison test
View gist:2177fc9fc3aaa03860b6
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 Jul 1, 2015
pygtk app to extract pixel sizes and colors from mockups
View mockup-viewer.py
#! /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 Sep 25, 2014
CanLoadSimpleProject failure
View gist:3b4866ea03e4545a7e2a
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) 
@havocp
havocp / gist:7048451
Last active Dec 25, 2015
Type safety in real life
View gist:7048451

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 Mar 3, 2013
My hacky rip script
View RipMusic.sh
#!/bin/bash
set -e
function die() {
echo "$*" 1>&2
exit 1
}
SKIP_RIP=0
View BatchingExecutionContext.scala
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scala.concurrent.impl
@havocp
havocp / example-akka-filtering.patch
Created Jun 5, 2012
example of filtering mima issues
View example-akka-filtering.patch
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 Jun 5, 2012
Patch to support filtering mima issues
View filter-reported-issues.patch
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 {
+
View null-actor-instance.patch
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
set the 'actor' field in ActorCell mid-actor-construction rather than post-construction
View actor-cell-mid-construction.patch
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`