Skip to content

Instantly share code, notes, and snippets.

View phpnode's full-sized avatar

Charles Pick phpnode

View GitHub Profile
describe.only("Bug #56: process out of memory", function () {
before(function () {
this.db = TEST_SERVER.use('Security', 'plocal');
this.queryText = "select *, map( 'schoolLocations', $slocs, 'governingInstitutions', $gis, 'clbs', $clbs, 'schoolCommunities', $scs, 'mainStructures', $mss ) as relations from School let slocE = outE()[ @class = 'controls' ], giE = inE()[ @class = 'controls' ], scE = inE()[ @class = 'controls' ], clbE = inE()[ @class = 'provides_services_for' ], msE = outE()[ @class = 'has_property' ], locs = list( (select format( '/schoollocations/%s', in.key ) as href, startDate, endDate from $slocE where in.@class = 'SchoolLocation' ) ), gis = list( (select format( '/governinginstitutions/%s', out.key ) as href, startDate, endDate from $giE where out.@class = 'GoverningInstitution' ) ), scs = list( (select format( '/schoolcommunities/%s', out.institutionNumber ) as href, startDate, endDate from $scE where out.@class = 'SchoolCommunity' ) ), clbs = list( (select format( '/clbs/%s', ou
<x-element></x-element>
<x-another-element></x-another-element>
<!-- web components should not modify anything apart from their children -->
<x-another-element>
<p>lala</p>
</x-another-element>
var foo = {};
Object.defineProperty(foo, 'bar', {
value: 123,
anotherKey: "hello world",
extraKey: true
});
var descriptor = Object.getOwnPropertyDescriptor(foo, 'bar');
var jade = require('jade');
// compile
var fn = jade.compile('p string of jade');
console.log(fn());
@phpnode
phpnode / leaky-args.js
Created December 15, 2014 23:32
node --allow-natives-syntax leaky-args.js
'use strict';
function leakyArgs (item) {
var args = Array.prototype.slice.call(arguments, 1);
var total = item;
for (var i = 0, length = args.length; i < length; i++) {
total += args[i] + (300 * 234 * 234234 * 235 * 23433);
}
return total;
}
function demo (input: Array<number>): Array<number> {
return function blah () {
return function foo () {
return input.map(item => item + 1).map(item => item + 2);
};
};
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Array#forEach</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
// This is how the world looks at the moment
import {render} from 'react-dom';
render(
<Router>
<Route path="/" component={HomeScreen} />
</Router>,
document.getElementById('root')
);