Skip to content

Instantly share code, notes, and snippets.

View jonstorer's full-sized avatar

Jonathon Storer jonstorer

View GitHub Profile
# Given the following tests
Given I create an invitation for "jon@shake.com"
And I create an invitation for "justin@lab49.com"
When I send my invitations
Then I should have sent emails to:
| email |
| jon@shake.com |
| justin@lab49.com |
@jonstorer
jonstorer / xcode.rake
Created October 14, 2014 15:14
Install & Use Xcode 5.1
namespace :xcode do
desc 'install xcode'
task :install => [:download, :mount, :link]
task :download do
# Whatever version you'd like
execute 'curl -o ~/Downloads/Xcode.dmg https://s3.amazonaws.com/[insert-your-bucket-here]/xcode_5.1.1.dmg'
end
task :mount do
@jonstorer
jonstorer / workers.js
Last active August 29, 2015 14:10
workers.js
var winston = require('winston')
, kue = require('kue')
, workers = require('./app/workers')
, queue = require('./config/queue');
Object.keys(workers).forEach(function(name){
Object.keys(workers[name]).forEach(function(task){
queue.process(name + '/' + task, 20, function(job, done){
var args = job.data.args || [];
@jonstorer
jonstorer / browser.coffee
Last active August 29, 2015 14:11
This is how we use webdriver in cucumber..
Shared = require './shared'
Data = require './data'
webdriver = require 'selenium-webdriver'
SeleniumServer = require('selenium-webdriver/remote').SeleniumServer
seleniumJar = require('selenium-server-standalone-jar')
server = null
driver = null
timeout = 200
browser = {}
@jonstorer
jonstorer / update_firefox.js
Last active August 29, 2015 14:17
Update Firefox on Codeship
#! /usr/bin/env node
var locate = require('mozilla-get-url')
, child_process = require('child_process')
, ProgressBar = require('progress')
, async = require('async')
, chalk = require('chalk')
, request = require('request')
, fs = require('fs-extra')
, path = require('path');
ShakeWeb.controller('AuditEventShowController', [
'$scope', '$compile', 'dataservice', '$templateCache' function(
$scope, $compile, dataservice, $templateCache ) {
var map = {
DraftCreatedAuditEvent:
'<div>' +
'<p>Draft Created by {{ audit_event.created_by_email }}</p>' +
'<p>{{ audit_event.created_at }}</p>' +
'</div>',
@jonstorer
jonstorer / AgreementController.js
Last active August 29, 2015 14:21
wtf angular
ShakeWeb.controller('AgreementController',
[ '$scope', '$stateParams', 'Agreement', '$q', function(
$scope, $stateParams, Agreement, $q ) {
$scope.status = 'No';
Agreement.find($stateParams.id).then(function (agreement) {
$scope.agreement = agreement;
});
@jonstorer
jonstorer / info.md
Last active August 29, 2015 14:25
node.js request proxy

This original request http://web.com/api/v1/resources hits the /api namespace and is sent to the proxy.js app. The proxy.js app recieves /v1/resources and uses that to build the new request to http:/api.com/v1/resources.

@jonstorer
jonstorer / proposed.js
Created September 17, 2015 14:28
Proposed API Endpoints
// MyStats
// /v1/comissions?created_at[gte]=Date&created_at[lt]=Date
[
{ }, { }
]
// /v1/comission_summary?created_at[gte]=Date&created_at[lt]=Date
@jonstorer
jonstorer / stuff.java
Created October 6, 2015 23:03
java all the things
public class ApplicationController {
private boolean ensure_valid_client() {
return current_oauth2_client.clientSecret == request.getClientSecret();
}
private OAuth2Client current_oauth2_client() {
return OAuth2Client oauth2Client = OAuth2Client.findById(request.getClientId());
}
}