Skip to content

Instantly share code, notes, and snippets.

View banshee's full-sized avatar

James Moore banshee

View GitHub Profile
@banshee
banshee / gist:3054567
Created July 5, 2012 16:08
Tests for the Java signature parser
package com.restphone.parser.test
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.Spec
import org.scalatest.FunSuite
import scala.collection.mutable.Stack
import com.google.common.collect._
import com.google.common.collect.Ranges
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@banshee
banshee / gist:3057175
Created July 5, 2012 23:47
for stackoverflow question
/***
Copyright (c) 2008-2012 CommonsWare, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
@banshee
banshee / gist:4408249
Created December 29, 2012 17:38
ValidationNEL scalatest matcher
Multiple markers at this line
- overloaded method value should with alternatives: (haveWord: ProguardConfigurationGenerationTest.this.HaveWord)(implicit ev:
ProguardConfigurationGenerationTest.this.Extent[scalaz.ValidationNEL[String,String]])ProguardConfigurationGenerationTest.this.ResultOfHaveWordForExtent[scalaz.ValidationNEL[String,String]] <and> (beWord:
ProguardConfigurationGenerationTest.this.BeWord)ProguardConfigurationGenerationTest.this.ResultOfBeWordForAnyRef[scalaz.ValidationNEL[String,String]] <and> (notWord:
ProguardConfigurationGenerationTest.this.NotWord)ProguardConfigurationGenerationTest.this.ResultOfNotWordForAnyRef[scalaz.ValidationNEL[String,String]] <and> (rightMatcher: org.scalatest.matchers.Matcher[scalaz.ValidationNEL[String,String]])Unit cannot be applied to (scalaz.ValidationNEL[String,String] =>
org.scalatest.matchers.MatchResult)
- overloaded method value should with alternatives: (haveWord: ProguardConfigurationGenerationTest.this.HaveWord)(implicit ev:
ProguardC
Script started on Tue Feb 26 22:24:35 2013
+ rm -rf /Users/james/tmp/scalatest-build-ecosystem
+ build scala-ide-2.1-m3 http://download.scala-ide.org/ecosystem/next/e37/scala29/dev/base/ 2.9.3-RC2 e37-scala29-m3 http://download.eclipse.org/releases/indigo/
+ cd /Users/james/src/scalatest-eclipse-plugin
+ mvn -Pset-versions -Pscala-ide-2.1-m3 -Drepo.scala-ide=http://download.scala-ide.org/ecosystem/next/e37/scala29/dev/base/ -Dscala.version=2.9.3-RC2 -Drepo.eclipse=http://download.eclipse.org/releases/indigo/ -Dtycho.style=maven --non-recursive exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Build project for the scalatest support in Scala IDE 2.9.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
@banshee
banshee / gist:5326974
Created April 6, 2013 17:56
Phantom errors
package com.restphone
import scala.collection.mutable
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.Props
import akka.actor.actorRef2Scala
import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory
@banshee
banshee / gist:5327073
Created April 6, 2013 18:22
presentation compiler log
"wait for more work"(
),
"atnode"(
1,
1365272025636),
"asked"(
),
"wait for more work"(
),
"atnode"(
@banshee
banshee / gist:5328177
Created April 6, 2013 23:55
bob and alice for typed channels
package com.restphone
import akka.actor.Actor
import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory
import akka.channels._
class Message
class Response
@banshee
banshee / gist:5544271
Created May 8, 2013 22:48
type provider on monotouch
Given this code:
open FSharp.Data
open System.Xml.Linq
type SomeSample = XmlProvider<"""<author name="Paul Feyerabend" born="1924" />""">
I get:
Error FS3033: The type provider 'ProviderImplementation.XmlProvider' reported an error: Specified argument is neither a file, nor well-formed XML: Could not find a part of the path "/<author name="Paul Feyerabend" born="1924" />". (FS3033) (fslib)
@banshee
banshee / gist:5565772
Created May 13, 2013 02:09
F# output
val it : SimpleNode list =
[{name = "val";
ancestors =
[{name = "bar";
ancestors = [{name = "foo";
ancestors = [];
content = null;
attributes = map [("snark", "boojum")];}];
content = null;
attributes = map [];}; {name = "foo";
@banshee
banshee / gist:7000449
Created October 15, 2013 23:46
Modify the output of swig for use with Xamarin
ARGF.each do |l|
case l
when /public delegate void Exception(Argument)?Delegate/
puts " [MonoTouch.MonoNativeFunctionWrapper]", l
when /static void SetPendingArgument(Null|OutOfRange)?Exception/
puts " [MonoTouch.MonoPInvokeCallback (typeof (ExceptionArgumentDelegate))]", l
when /static void SetPending.*Exception/
puts " [MonoTouch.MonoPInvokeCallback (typeof (ExceptionDelegate))]", l
when /static string CreateString/
puts " [MonoTouch.MonoPInvokeCallback (typeof (SWIGStringDelegate))]", l