Skip to content

Instantly share code, notes, and snippets.

@sdwilsh
sdwilsh / BufferAPIS
Created May 8, 2011 19:11
Contains a list of APIs that are declared in buffer.js and in node_buffer.cc (exposed to JS)
On Buffer (only exposed to JS):
Constructor (documented)
poolSize
isBuffer (documented)
byteLength (documented)
On Buffer Instances:
write (documented)
toString (documented)
[] operator (documented)
@sdwilsh
sdwilsh / testTypedArrays.cpp
Created May 9, 2011 20:00
JS API test file for possible Typed Arrays Bug
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*/
#include "tests.h"
#include "jsobj.h"
BEGIN_TEST(testPrototypeLookup)
{
jsval arrVal;
@sdwilsh
sdwilsh / gist:969299
Created May 12, 2011 19:49
mozilla-central changeset to try changeset mapping (in order)
m-c changeset = try changeset
"5798118100e1" = "5f39932f196b"
"6119349e864e" = "bf685f38c9b5"
"f668f71d3a22" = "cf56e4f324ad"
"0d98ff9aef32" = "729dff6c0b2b"
"f4e5b9438d17" = "01345ca1bff0"
"aa6dac5f1d10" = "2092ab1e51f3"
"a2945f365208" = "40fb5006f0b6"
"edb10c83d7ce" = "12449f886c17"
"31cf1c8d1672" = "f15fe21b6365"
@sdwilsh
sdwilsh / csv.js
Created May 13, 2011 18:55
Generates csv output for the runs
// If running this from Scratchpad, the context must be https://hg.mozilla.org/
let changesets = [
];
let url = "http://graphs.mozilla.org/api/test/runs/revisions?" + changesets.map(function(cset) {
return "revision=" + cset;
}).join("&");
let req = new XMLHttpRequest();
req.open("GET", url, false);
req.send(null);
let result = JSON.parse(req.responseText).revisions;
@sdwilsh
sdwilsh / gist:972707
Created May 14, 2011 22:34
Script to generate hg commands to push a set of changes to the try server
let changes = [
/* changes go here */
];
let commands = [];
changes.forEach(function(cset) {
commands.push("hg qpop -a");
commands.push("hg update -C " + cset);
commands.push("hg qpush");
commands.push("hg identify >> pushes.txt");
commands.push("hg push -f try");
@sdwilsh
sdwilsh / gist:997446
Created May 29, 2011 03:41
builds.js output
// success
{ key: 'build.mozilla-central_snowleopard_test-mochitest-other.145.step.mochitest-ipcplugins.finished',
buildid: '20110528184045',
platform: 'macosx64',
slave: 'talos-r3-snow-036',
rev: '5d7b5f2ea603',
result: 0,
tree: 'mozilla-central',
pusher: 'masayuki@d-toybox.com' }
// failure
@sdwilsh
sdwilsh / gist:1003113
Created June 1, 2011 19:39
Script used to be a buildslave (x86)
SET MOZBUILDDIR=c:\mozilla-build\
@echo off
SET MOZ_MSVCVERSION=9
SET MOZILLABUILD=%MOZBUILDDIR%
echo "Mozilla tools directory: %MOZBUILDDIR%"
REM Get MSVC paths
@sdwilsh
sdwilsh / gist:1003118
Created June 1, 2011 19:40
Script used to be a buildslave (x86-64)
SET MOZBUILDDIR=c:\mozilla-build\
@echo off
SET MOZ_MSVCVERSION=9
SET MOZILLABUILD=%MOZBUILDDIR%
echo "Mozilla tools directory: %MOZBUILDDIR%"
REM Get MSVC paths
@sdwilsh
sdwilsh / like_test.html
Created August 25, 2011 00:32
Like button test page
<html>
<head>
<title>Test Page</title>
</head>
<body>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=167435886666146&amp;xfbml=1"></script><fb:like href="http://shawnwilsher.com/" send="true" width="450" show_faces="true" action="like" font=""></fb:like>
</body>
@sdwilsh
sdwilsh / send_test.html
Created August 25, 2011 00:33
Send button test page
<html>
<head>
<title>Test Page</title>
</head>
<body>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:send href="http://shawnwilsher.com/" font=""></fb:send>
</body>