Skip to content

Instantly share code, notes, and snippets.

View lloyd's full-sized avatar

Lloyd Hilaiel lloyd

View GitHub Profile
@lloyd
lloyd / update_gh-pages.sh
Created May 19, 2011 17:12
A lil script to create a gh-pages branch from a subset of the repository. EXPENSIVE
$ git branch -D gh-pages
$ git branch gh-pages
$ git filter-branch --subdirectory-filter test/ gh-pages
$ git push -f origin gh-pages:gh-pages
1. put <file> on sdcard
2. put sdcard in device
3. reboot and hold down up arrow and power for 10s.
4. "apply update from external storage" - select <file>
5. "wipe data/factory reset"
6. reboot
Now you've got an unrooted phone. Let's install a su binary that gives us root.
1. download root-zte-open.zip (md5 cecc15bd0cc315633d066d81b44d7732)
var http = require('http'),
toobusy = require('toobusy');
console.log("Maximum allowed event loop lag: " + toobusy.maxLag(50) + "ms");
function processRequest(res, num, startTime) {
if (!startTime) startTime = new Date();
if (num === undefined) {
return process.nextTick(function() {
@lloyd
lloyd / mapvslice_test.go
Created July 19, 2017 09:03
maps vs slices for mapping small sets of ordinals to values
package whatever
import (
"testing"
)
func BenchmarkMapConstruction(b *testing.B) {
space := make([]map[int][]string, b.N)
for n := 0; n < b.N; n++ {
space[n] = map[int][]string{
[lth@lappro ~] $ mkdir test
[lth@lappro ~] $ cd test/
[lth@lappro test] $ git init
Initialized empty Git repository in /Users/lth/test/.git/
[lth@lappro test] $ mkdir foo
[lth@lappro test] $ mkdir foo/bar
[lth@lappro test] $ touch foo/bar/baz
[lth@lappro test] $ touch foo/bar/bing
[lth@lappro test] $ touch foo/bar/boom
[lth@lappro test] $ git add foo/
--- emacs-22.1.orig/src/unexmacosx.c 2007-01-20 21:18:15.000000000 -0700
+++ emacs-22.1/src/unexmacosx.c 2007-10-31 10:32:19.000000000 -0600
@@ -448,10 +448,9 @@
case, trailing pages are initialized with zeros. */
for (p = ranges->address + ranges->size; p > ranges->address;
p -= sizeof (int))
- if (*(((int *) p)-1))
+ if (*(((char *) p)-1))
break;
Title
[Please provide a descriptive (but short) title for your session.]
Embedding Ruby for Fun and Profit
Description
[Provide a short summary description of your session topic. This will
be posted publicly if your proposal is accepted.]
Life is too short to write native code. It takes too long, it works
@lloyd
lloyd / assertion sizes.txt
Created December 20, 2013 10:44
assertion sizes
(format: idp key algorithm / user key algorithm / size in bytes)
New formats:
RS/64 RS/64 612
RS/64 RS/128 811
RS/64 RS/256 1210
RS/64 DS/128 1199
RS/64 DS/256 1937
RS/128 RS/64 698
RS/128 RS/128 897
$ bin/load_gen -u 1/10000 -m 1100000 -a include_only -s http://127.0.0.1:10002
with 1100000 active users there will be:
2.25 signup activites per second
0.45 reset_pass activites per second
0.90 add_email activites per second
1.80 reauth activites per second
100.98 signin activites per second
391.29 include_only activites per second
0.23 change_pass activites per second
11.36 interaction_data activites per second
$ bin/load_gen -u 1/10000 -m 1100000 -a include_only -s http://127.0.0.1:10002
with 1100000 active users there will be:
2.25 signup activites per second
0.45 reset_pass activites per second
0.90 add_email activites per second
1.80 reauth activites per second
100.98 signin activites per second
391.29 include_only activites per second
0.23 change_pass activites per second
11.36 interaction_data activites per second