Skip to content

Instantly share code, notes, and snippets.

View jbpros's full-sized avatar
🖐️
yo

Julien Biezemans jbpros

🖐️
yo
View GitHub Profile
@jbpros
jbpros / app.js
Last active August 29, 2015 13:56 — forked from anonymous/app.js
app.post(/^\/mobiles\/.*/, function (req, res) {
var postUrl = "https://d3v0fbs.net" + req.url;
req.pipe(request.post(postUrl)).pipe(res);
});
@jbpros
jbpros / test.feature
Last active December 16, 2015 05:59 — forked from anonymous/gist:5388516
Scenario: Create an invoice
Given I am an authenticated user with an admin role
And there is a work unit ready to be invoiced on a client's project
When I associate an invoice number to the work unit
Then The concerned client is not in the admin invoices page
Feature: Mailing Wizard
In order to send a Mailing
As an Administrator
I need to be able to create a Mailing
Scenario: Check the first tab has fields
Given I am on the Mailing Wizard
When I am on the first tab
Then I should see a "Mailing Name" input
And I should see a "Description" input
@jbpros
jbpros / ERROR
Created September 21, 2012 21:58 — forked from Pitbi/ERROR
DEBUG: TypeError: Cannot read property 'value' of undefined
at _asyncMap (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:185:23)
at async.forEachSeries.iterate (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:108:13)
at async.forEachSeries.iterate (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:119:25)
at _asyncMap (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:187:17)
at async.series.results (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:491:34)
at async.forEach (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:94:25)
at bestLapSearch (/home/pitbi/Projects/RaceLive/lib/rfactor_xml_parser.js:188:19)
at async.forEach (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:86:13)
at Array.forEach (native)
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var qualificationSchema = new mongoose.Schema ({
date : Date,
track : {type: Schema.ObjectId, ref : 'Track'},
mod : {type: Schema.ObjectId, ref : 'Mod'},
entrys : [entrySchema]
});
var Qualification = mongoose.model('Qualification', qualificationSchema);
server.get('/parseXML2', function (req, res) {
fs.readFile('./export/2012_09_13_22_14_10-63Q1.xml', function (err, file) {
var xml = libxmljs.parseXml(file);
var date = xml.get("/rFactorXML/RaceResults/TimeString").text();
var track = xml.get("/rFactorXML/RaceResults/TrackEvent").text();
var trackLength = xml.get("/rFactorXML/RaceResults/TrackLength").text();
var mod = xml.get("/rFactorXML/RaceResults/Mod").text();
var drivers = xml.find("//Driver");
Track.findOne({name: track}).exec(function (err, existingTrack) {
TypeError: Object #<World> has no method 'visit'
at World.<anonymous> (/Users/jnh/Dev/ember-newsflash/features/step_definitions/inMemoryAdapter.coffee:8:19)
at Object.invoke (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/support_code/step_definition.js:29:14)
at Object.execute (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/ast/step.js:142:22)
at Object.acceptVisitor (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/ast/step.js:133:12)
at Object.executeStep (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:170:12)
at Object.processStep (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:165:14)
at /Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:67:16
at callUserFunctionAndBroadcastAfterEvent (/Users/jnh/Dev/ember-newsflash/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:91:9)
@jbpros
jbpros / gist:1322767
Created October 28, 2011 17:00 — forked from Slicertje/gist:1322603
Detect if callback is called
function doTest (callback) {
var isCallbackCalled = false;
var successCallback = function () {
isCallbackCalled = true;
};
callback.apply(null, [ successCallback ]);
if (isCallbackCalled) {
# activity.rb
def full_duration
return (duration_in_minutes.to_f / 60).round(1)
end
# activity_spec.rb
describe "full_duration()" do
context "when duration_in_minutes is saved in the database" do