Skip to content

Instantly share code, notes, and snippets.

View creswick's full-sized avatar

Rogan Creswick creswick

View GitHub Profile

Keybase proof

I hereby claim:

  • I am creswick on github.
  • I am creswick (https://keybase.io/creswick) on keybase.
  • I have a public key ASAvh8Oe5bg5mpzCuBvrEU5sHDPBlv2olxajwOg-qP_9-go

To claim this, I am signing this object:

@creswick
creswick / ExampleSpec.scala
Created March 7, 2017 01:03
forAll fails to generate different values
import collection.mutable.Stack
import org.scalatest._
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalacheck.Gen
import org.scalacheck.Gen.{ listOf, Choose }
import org.scalacheck.Gen
// Built & run with:
@creswick
creswick / keybase.md
Created February 15, 2016 18:58
keybase.md

Keybase proof

I hereby claim:

  • I am creswick on github.
  • I am creswick (https://keybase.io/creswick) on keybase.
  • I have a public key whose fingerprint is A839 5262 9C0C E3BB 3B6D 8358 B7EE 9F2E 4FB1 8B9E

To claim this, I am signing this object:

@creswick
creswick / describe.out
Created January 23, 2016 04:31
ghc-pkg-7.8.4 describe Cabal
$ ghc-pkg-7.8.4 describe Cabal
name: Cabal
version: 1.22.4.0
id: Cabal-1.22.4.0-7d9c331edef1f9171a00f5a1f9e87ceb
license: BSD3
copyright: 2003-2006, Isaac Jones
2005-2011, Duncan Coutts
maintainer: cabal-devel@haskell.org
stability:
homepage: http://www.haskell.org/cabal/

Keybase proof

I hereby claim:

  • I am creswick on github.
  • I am creswick (https://keybase.io/creswick) on keybase.
  • I have a public key whose fingerprint is E148 A11E 2EB9 4B8C 80B3 4369 119E BAC1 A018 315C

To claim this, I am signing this object:

@creswick
creswick / QRCodePureBarcodeRoundTripTest.java
Created May 31, 2014 19:02
Property-based Junit test to check that zxing barcodes will round-trip with PURE_BARCODE
package com.galois.qrstream.qrpipe;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
@XStreamAlias("sample")
public class Sample {
@XStreamAsAttribute
@XStreamAlias("myns:name")
public final String name;
@creswick
creswick / Setup.hs
Created June 5, 2012 17:07
Cabal Setup.hs to copy scripts during postInst:
import Control.Monad ( unless )
import Distribution.Simple
import Distribution.Simple.Program.Types ( Program(..), simpleProgram )
import Distribution.PackageDescription ( PackageDescription(..), executables,
hsSourceDirs, exeName, buildInfo )
import Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(..), buildDir, bindir
, substPathTemplate, absoluteInstallDirs )
import Distribution.Simple.Setup ( InstallFlags(..), BuildFlags, Flag, fromFlag
, buildVerbose, CopyFlags(..), defaultCopyFlags )
import Distribution.Simple.Utils ( rawSystemExit, findProgramVersion)
@creswick
creswick / WebTest.java
Created January 10, 2012 23:04
Selenium.runScript(String) throws exceptions if string contains \r
public class WebTest {
public static void main(String[] args) throws IOException {
WebDriver driver = new FirefoxDriver();
Selenium selenium = new WebDriverBackedSelenium(driver, "http://google.com");
selenium.runScript("/* line 1 \r\n line 2 */");
}
}
@creswick
creswick / WebTest.java
Created January 10, 2012 06:47
ChromeDriver causes stack overflow if you specify the path to chrome via ChromeOptions
import java.io.File;
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
public class WebTest {
public static void main(String[] args) throws IOException {