Skip to content

Instantly share code, notes, and snippets.

View phpnode's full-sized avatar

Charles Pick phpnode

View GitHub Profile
@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;
}
var jade = require('jade');
// compile
var fn = jade.compile('p string of jade');
console.log(fn());
var foo = {};
Object.defineProperty(foo, 'bar', {
value: 123,
anotherKey: "hello world",
extraKey: true
});
var descriptor = Object.getOwnPropertyDescriptor(foo, 'bar');
<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>
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
<article about="/spin/latest/">
<partial template="article-header">
<h1>What's been spinning on the radio?</h1>
</partial>
<partial template="signup-link" />
<p>
<span property="stats.total"></span>
<if condition="stats.total == 1">Recent spin.</if>
<else>Recent spins.</else>
Click for full playlist.
class AutoWhat
constructor: ->
console.log "constructing"
foo: => console.log this
window["whatever"] = ->
AutoWhat::constructor.apply this, arguments
for attr, val of AutoWhat::
window["whatever"]::[attr] = val
b = new whatever
from pygments.formatter import Formatter
import json
class Formatter(Formatter):
name = 'JSON'
aliases = ['json']
filenames = []
def format(self, tokensource, outfile):
arr = []
# Set up our requirements
request = require "request"
chai = require "chai"
chai.should()
# The API provides several methods for interacting with users.
describe "API user", ->
# Get a list of records. The set of returned attributes for list may be different from view.
describe "list", ->