Skip to content

Instantly share code, notes, and snippets.

View jjgonecrypto's full-sized avatar
🔗
Eth wrangling.

j-j.eth jjgonecrypto

🔗
Eth wrangling.
View GitHub Profile
@jjgonecrypto
jjgonecrypto / NamedClosures.as
Created August 15, 2011 21:28
Giving closures a name
public class Something extends EventDispatcher
{
private var outterHandler:Function;
private var innerHandler:Function;
public function init():void
{
outerHandler = function(evt:UserEvent):void
{
service = new Service();
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.justinjmoses.examples</groupId>
<artifactId>closures-cleaning-example</artifactId>
<version>1.0-SNAPSHOT</version>
module NavigationHelpers
def path_to(page_name)
case page_name
#services
when /the list of services/
services_path
when /a new service/
new_service_path
when /edit the service named "([^"]*)"/
var User = require('../../models/user');
module.exports = function(){
this.World = require('../support/world').World;
this.When(/^I go to create a new user$/, function(next) {
this.visit('/users/new', next);
});
this.When(/^I enter "([^"]*)" as the "([^"]*)"$/, function(value, field, next) {
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>1.0.0-SNAPSHOT</version>
this.browser.clickLink(link, function(e, b, s) {
b.onconfirm(function(q){ return true; });
callback(e,b,s);
});
Feature: Present clearly
As a presenter
I'd like to ensure my content is clear and concise
So that my audience understand the value of Cucumber
Scenario: Ensure audience can see the presentation
Given I start the presentation off
Then the audience should be able to see the initial slide
And the slide should have the content "green like a cuke!"
@jjgonecrypto
jjgonecrypto / main.coffee
Created June 18, 2012 18:04
require 2.0 shims
require.config
baseUrl: '/static/coffee/app'
paths:
text: '/static/js/require.text'
underscore: '/static/js/underscore-min'
backbone: '/static/js/backbone-min'
backboneTP: '/static/js/backbone-tastypie'
shim:
underscore:
exports: '_'
@jjgonecrypto
jjgonecrypto / gist:3195313
Created July 28, 2012 23:45
mimic jquery selectors from unattached html (as text) in webkit
doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html')
doc.documentElement.innerHTML = "<div><p class='first'>...</p></div>"
nodeList = doc.querySelectorAll(".first")
@jjgonecrypto
jjgonecrypto / example.coffee
Created August 24, 2012 15:16
little coffeescript class quiz
class Person
info: {}
setName: (name) -> @info.name = name
justin = new Person()
justin.setName "justin"
paul = new Person()