Skip to content

Instantly share code, notes, and snippets.

@sixman9
sixman9 / Minimal Gradle+Geb build script
Created September 7, 2011 00:11 — forked from kellyrob99/Minimal Gradle+Geb build script
Gives a Gradle build with IDE and maven support, ready to go for Geb and Spock and the Firefox web driver.
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'project-report'
version = '1.0-SNAPSHOT'
group = ''
versions = [
@sixman9
sixman9 / README.md
Created February 22, 2012 10:59 — forked from TooTallNate/README.md
'cflags' parameter is broken in gyp on OS X?

This is a barebones GYP file to compile 1 C source file. We are demonstrating that the cflags parameter in gyp files gets completely ignored :(

$ ../gyp/gyp -f make --depth=. hello.gyp
$ V=1 make
  cc   -fasm-blocks -mpascal-strings -Os -gdwarf-2  -MMD -MF out/Default/.deps/out/Default/obj.target/hello/hello.o.d.raw  -c -o out/Default/obj.target/hello/hello.o hello.c
  ./gyp-mac-tool flock out/Default/linker.lock g++ -Lout/Default   -o "out/Default/hello" out/Default/obj.target/hello/hello.o 
  LINK(target) out/Default/hello: Finished
@sixman9
sixman9 / GoogleDemoTest.java
Created August 31, 2012 14:20 — forked from chbaranowski/GoogleDemoTest.java
Sikuli JUnit Demo Test
//Found at http://tux2323.blogspot.co.uk/2011/06/sikuli-gui-test-automation-with-java.html
import org.junit.Test;
import org.sikuli.script.App;
import org.sikuli.script.Screen;
public class GoogleDemoTest {
@Test
public void testGoogleSearch() throws Exception {
@sixman9
sixman9 / gist:3561357
Created August 31, 2012 23:52 — forked from rodionmoiseev/gist:2484934
Setting up Play 2.0 in build.gradle
apply plugin: 'java'
apply plugin: 'scala'
// For those using Eclipse or IntelliJ IDEA
apply plugin: 'eclipse'
apply plugin: 'idea'
def findPlay20(){
def pathEnvName = ['PATH', 'Path'].find{ System.getenv()[it] != null }
for(path in System.getenv()[pathEnvName].split(File.pathSeparator)){
for(playExec in ['play.bat', 'play.sh', 'play']){
@sixman9
sixman9 / mvn2sbt.scala
Created September 7, 2012 14:11 — forked from retronym/mvn2sbt.scala
mvn2sbt: quick hack to turn <dependencies> into SBT
object scala {
val version = "SCALA_VERSION$"
}
val xml = <dependencies>
<dependency>
<groupId>org.scalanlp</groupId>
<artifactId>scalala_${scala.version}</artifactId>
<version>0.3.1</version>
</dependency>
@sixman9
sixman9 / sbt
Created September 14, 2012 10:58 — forked from trygvis/sbt
My SBT wrapper scripts
#!/bin/sh
if [ -z "$SBT_VERSION" ]
then
SBT_VERSION=0.7.7
fi
JAR=$HOME/.sbt/sbt-launch-$SBT_VERSION.jar
mkdir -p $HOME/.sbt
@sixman9
sixman9 / gist:3811894
Created October 1, 2012 13:48 — forked from notanumber/gist:3350538
Simple Quad
#ifndef TEMPLATEGAME_H_
#define TEMPLATEGAME_H_
#include "gameplay.h"
using namespace gameplay;
class TestApp : public Game
{
public:
@sixman9
sixman9 / gist:3811895
Created October 1, 2012 13:49 — forked from notanumber/gist:3353668
Simple Triangle
#ifndef TEMPLATEGAME_H_
#define TEMPLATEGAME_H_
#include "gameplay.h"
using namespace gameplay;
class TestApp : public Game
{
public:
#!/bin/bash
function _usage() {
cat <<USAGE
usage: $(basename $0) PATTERN [FILES]
Print the HTML that matches the CSS selector PATTERN.
USAGE
}

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.