Skip to content

Instantly share code, notes, and snippets.

View antony's full-sized avatar
:octocat:
Loving SvelteJS

Antony Jones antony

:octocat:
Loving SvelteJS
View GitHub Profile
### Keybase proof
I hereby claim:
* I am antony on github.
* I am aiten (https://keybase.io/aiten) on keybase.
* I have a public key whose fingerprint is 17B8 82E3 9AE7 A87E 11FE 4F78 DEEF 31AE A794 9547
To claim this, I am signing this object:
@antony
antony / gist:282033be1dae877fea45
Created October 10, 2014 15:59
Create a Jenkins view filter.
<!--
You need to install the 'anything-goes' plugin and enable it, first:
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=60915753
Then click 'edit description' on your view, and just paste this whole file into it and click save.
Done. Type to filter.
-->
<input class="search" placeholder="Type to filter..." style="font-size: 24px; padding: 10px; height: 50px; width: 100%;" autofocus />
<script>
!function(){function a(b,c,d){var e=a.resolve(b);if(null==e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];if(!g._resolving&&!g.exports){var h={};h.exports={},h.client=h.component=!0,g._resolving=!0,g.call(this,h.exports,a.relative(e),h),delete g._resolving,g.exports=h.exports}return g.exports}a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],d=0;d<c.length;d++){var b=c[d];if(a.modules.hasOwnProperty(b))return b;if(a.aliases.h

Modelling Family, Friends, Enemies, Pets and Deaths in the Wizarding World

Setup

@antony
antony / grails-geb
Created February 14, 2012 11:54
A properly configured BuildConfig.groovy for running Geb under Grails 2.0
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.dependency.resolution = {
inherits("global") {
}
log "warn"
@antony
antony / ExampleTemplateRenderingHelperSpec.groovy
Created October 21, 2015 13:55
Handlebars Testing Framework for Ratpack
package pm.renderer.handlebars
import com.github.jknack.handlebars.Handlebars
import com.github.jknack.handlebars.Options
import com.github.jknack.handlebars.Template
import energizedwork.support.HandlebarsSpecification
import ratpack.handlebars.NamedHelper
import spock.lang.Ignore
class ExampleTemplateRenderingHelperSpec extends HandlebarsSpecification<TemplateRenderingHelper, String> {
@antony
antony / spock.sjs
Last active November 21, 2015 11:42
Writing spock language in javascript with sweet.js (WIP)
let spec = macro {
rule { $name:lit { $body ... } } => {
describe($name, function () {
$body ...
});
}
}
@antony
antony / ShiroAwareSpecification.groovy
Created November 30, 2015 10:28
Unit Testing Shiro Subjects with Spock
class ShiroAwareSpecification extends Specification {
@Shared Subject subject
@Shared ThreadState threadState
void setupSpec() {
subject = Mock(Subject)
threadState = new SubjectThreadState(subject)
threadState.bind()
}
@antony
antony / gist:5907972
Created July 2, 2013 09:36
Angular Select Box DSL Extension for retreiving Options.
angular.scenario.dsl('selectBox', function() {
var chain = {};
chain.option = function(value) {
return this.addFutureAction("select '" + this.name + "' option '" + value + "'", function($window, $document, done) {
var select = $document.elements('select[name="$1"]', this.name);
var option = select.find('option[value="' + value + '"]');
if (option.length) {
select.val(value);
} else {
@antony
antony / TestShard.groovy
Created July 4, 2013 13:41
Parallelise your Grails functional tests! Put this in your scripts dir.
import org.codehaus.groovy.grails.test.support.GrailsTestTypeSupport
import org.codehaus.groovy.grails.test.GrailsTestTypeResult
import org.codehaus.groovy.grails.test.event.GrailsTestEventPublisher
import org.codehaus.groovy.grails.test.GrailsTestTargetPattern
includeTargets << grailsScript("_GrailsClean")
includeTargets << grailsScript("_GrailsTest")
// grails t-s shard=1 shards=4
@antony
antony / stripe-checkout.js
Last active January 4, 2016 04:29
Faking out the Stripe CheckoutJS for Functional Tests. A simple drop-in replacement for https://checkout.stripe.com/checkout.js for your functional test environment.
var handler,
StripeHandler = new Klass({
initialize: function(token) {
this._callback = token;
},
open: function(attrs) {
var _self = this,
button = $('<button id="dummy-stripe">').html(attrs.description),
overlay = $('<div>', {id: 'dummy-stripe-overlay', style: "position: absolute; width: 20%; height: 40%; background-color: #fff; top: 30%; left: 40%; border: 4px solid #000; display: block; margin: auto auto;"}).html(button);
$('body').append(overlay);