Skip to content

Instantly share code, notes, and snippets.

Jez Ng int3

Block or report user

Report or block int3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View foo.html
<html>
<body>
<script type="text/javascript" charset="utf-8" src='foo.js'></script>
</body>
</html>
@int3
int3 / ls.scm
Last active Dec 15, 2015
An implementation of `ls', for [The Guile 100 Programs Project](http://www.lonelycactus.com/guile100/).
View ls.scm
#! /usr/local/bin/guile -s
!#
(use-modules (srfi srfi-1) ; fold, map etc
(srfi srfi-26) ; cut (partial application)
(srfi srfi-37) ; args-fold
(ice-9 ftw)
(ice-9 format)
(ice-9 i18n))
@int3
int3 / gist:5250850
Last active Dec 15, 2015
Simple memcached benchmarking script.
View gist:5250850
package main
import (
"fmt";
"strings";
"time";
"math/rand";
"strconv";
"github.com/bradfitz/gomemcache/memcache"
)
@int3
int3 / hashtable.c
Created Dec 10, 2012
Simple open-addressed hashtable
View hashtable.c
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
// no actual pointer should have this value, due to alignment
static void* DELETED = (void*)1;
static int TABLE_SIZE = 701;
@int3
int3 / gist:4027626
Created Nov 6, 2012
Chained comparisons using sweet.js
View gist:4027626
macro $if {
case ($x ...) => { if (relCar($x ...)) }
}
macro $while {
case ($x ...) => { while (relCar($x ...)) }
}
// naive form:
/*
@int3
int3 / gist:4013740
Created Nov 4, 2012
Coffeescript's `do` notation as a sweet.js macro
View gist:4013740
macro $do {
case ($($x = $y) (,) ...) $body => {
(function ($x (,) ...) $body)($y (,) ...)
}
case $name ($($x = $y) (,) ...) $body => {
(function $name ($x (,) ...) $body)($y (,) ...)
}
}
$do (a = 1, b = 2) {
@int3
int3 / status.md
Created Aug 22, 2011
Session Restore e10s Status
View status.md

TODO:

  • Create a notification to indicate when the active page style changes

  • We probably should not use userTypedValue (which is in chrome) to manipulate the loaded URI of a tab (which is in content.)

  • Skipping test 461743 for now -- seems like it might not be relevant once we move to e10s anyway

  • Listen for pushstate and popstate events as well?

View gist:1122056
# User Jez Ng <jezreel@gmail.com>
Bug 632555 - Scale about:sessionrestore's treeview based on viewport height. r=zpao
diff --git a/browser/components/sessionstore/content/aboutSessionRestore.xhtml b/browser/components/sessionstore/content/aboutSessionRestore.xhtml
--- a/browser/components/sessionstore/content/aboutSessionRestore.xhtml
+++ b/browser/components/sessionstore/content/aboutSessionRestore.xhtml
@@ -81,17 +81,16 @@
<ul>
<li>&restorepage.restoreSome;</li>
@int3
int3 / deanon.py
Created Jul 20, 2011
De-anonymize JS functions
View deanon.py
#! /usr/bin/env python
"""
Usage: cat [infile] | python deanon.py > [outfile]
Anonymous functions will be renamed to anon_[lineno]_*
where * is a number that gets incremented for each functionon the line
"""
from sys import stdin, stdout, stderr, argv
@int3
int3 / postprocess.py
Created Jul 20, 2011
Postprocess chrome->content analysis output
View postprocess.py
#! /usr/bin/env python
"""
Usage: python postprocess.py [logfile] [src files we're interested in] > out.html
Incl.: offending calls from callee get added to the caller's count
Excl.: offending calls from callee do not get added to the caller's count
"""
import sys, re
from collections import defaultdict
You can’t perform that action at this time.