Skip to content

Instantly share code, notes, and snippets.

Avatar
🔗
Eth wrangling.

justin j. moses justinjmoses

🔗
Eth wrangling.
View GitHub Profile
@justinjmoses
justinjmoses / NamedClosures.as
Created Aug 15, 2011
Giving closures a name
View NamedClosures.as
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();
View pom.xml
<?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>
View fancy-pants.rb
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 "([^"]*)"/
View user-steps.rb
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) {
View pom.xml
<?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>
View .js
this.browser.clickLink(link, function(e, b, s) {
b.onconfirm(function(q){ return true; });
callback(e,b,s);
});
View cucumber.feature
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!"
View main.coffee
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: '_'
@justinjmoses
justinjmoses / gist:3195313
Created Jul 28, 2012
mimic jquery selectors from unattached html (as text) in webkit
View gist:3195313
doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html')
doc.documentElement.innerHTML = "<div><p class='first'>...</p></div>"
nodeList = doc.querySelectorAll(".first")
@justinjmoses
justinjmoses / example.coffee
Created Aug 24, 2012
little coffeescript class quiz
View example.coffee
class Person
info: {}
setName: (name) -> @info.name = name
justin = new Person()
justin.setName "justin"
paul = new Person()
You can’t perform that action at this time.