Skip to content

Instantly share code, notes, and snippets.

View mpj's full-sized avatar

Mattias Petter Johansson mpj

View GitHub Profile
@mpj
mpj / focusbugtest.html
Created April 29, 2012 08:25
Meteor focus bug test
<head>
<title>Focus event bug test</title>
</head>
<body>
{{> someTemplate}}
</body>
<template name="someTemplate">
<!-- Remove this wrapping span and the focus event will start working. -->
@mpj
mpj / deepEquals.js
Created May 2, 2012 14:49
deepEquals.js
// Forked from the node.js assert module, partly because it's not
// exposed as a boolean-returning function, and I needed to extend it
// to use any equals() method available.
module.exports = _deepEqual;
function _deepEqual(actual, expected) {
// 7.1. All identical values are equivalent, as determined by ===.
if (actual === expected) {
@mpj
mpj / gist:2620753
Created May 6, 2012 07:19
openrecipe-npm-install-failure
mpj-mbp:openrecipe-api mpj$ npm install -d
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info preinstall [email protected]
npm info addNamed [ 'connect', '2.2' ]
npm info addNamed [ 'express', '2.5' ]
npm info addNamed [ 'restify', '1.4.1' ]
npm info addNamed [ 'xregexp', '1.5' ]
npm info addNamed [ 'underscore', '1.3' ]
@mpj
mpj / gist:2622237
Created May 6, 2012 13:00
nytt fel
mpj-mbp:openrecipe-api mpj$ npm install -d
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info preinstall [email protected]
npm info addNamed [ 'sugar', '1.2' ]
npm info addNamed [ 'connect', '2.2' ]
npm info addNamed [ 'restify', '1.4.1' ]
npm info addNamed [ 'logule', '0.5' ]
npm info addNamed [ 'vows', '0.6' ]
@mpj
mpj / gist:2622315
Created May 6, 2012 13:26
favorit i repris
npm install -d
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info preinstall [email protected]
npm info addNamed [ 'connect', '1.8' ]
npm info addNamed [ 'restify', '1.4' ]
npm info addNamed [ 'logule', '0.5' ]
npm info addNamed [ 'vows', '0.6' ]
npm info addNamed [ 'api-easy', '0.3' ]
@mpj
mpj / felfel
Created May 7, 2012 18:58
fel fel fel
mpj-mbp:openrecipe-api mpj$ git pull
Updating e49fd8f..8a69162
Fast-forward
TODO | 56 ++++-
package.json | 1 -
spec/api/v1/recipes/get_spec.js | 267 ++++++++++++----------
spec/api_spec.js | 17 +--
spec/fixtures/api/v1/recipes/get/collection.json | 1 -
spec/fixtures/api/v1/recipes/get/resource.json | 1 -
spec/spec_helper.js | 33 ++-
mpj-mbp:openrecipe-scraper mpj$ vows
········· ·········· ············································· ······························ ················· ····· ··· ········ 23:55:43 - INFO - :: PARSING: http://www.alltommat.se/recept/Chili-con-carne-320
23:55:43 - INFO - :: PARSING: http://www.alltommat.se/recept/Jordgubbscheesecake-pa-kladdkaksbotten-10151
{
created_at: '2012-05-08 09:55:47 UTC',
system: {
parsing: { started_at: 1336514147519, ended_at: 1336514147632 },
fetching: { started_at: 1336514143912, ended_at: 1336514147519 }
},
notes: {},
@mpj
mpj / gist:2776653
Created May 23, 2012 17:52
Experimental two-way binding helper for presenters.
ChangeWatcher.watch(this, ['projectService', 'currentProject'], function():void {
bind('introTitleA').to('projectService', 'currentProject', 'introTextPrimary').twoWay();
});
/**
* Shorthand for binding a property (target) on the object
* to another property on the object (source).
*/
package
{
public class TestStuffThing
{
public function TestStuffThing()
{
var funca:Function,
runs:int = 10000000,
i:int,