Skip to content

Instantly share code, notes, and snippets.

View awwong1's full-sized avatar
🕳️
some

Alexander Wong awwong1

🕳️
some
View GitHub Profile
# https://github.com/cleanbrowsing/dnsperftest
# NO VPN FROM HOME
➜ dnsperftest git:(master) ./dnstest.sh | sort -k 22 -n
test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average
cloudflare 40 ms 41 ms 29 ms 36 ms 36 ms 30 ms 29 ms 28 ms 32 ms 40 ms 34.10
level3 41 ms 42 ms 49 ms 55 ms 55 ms 52 ms 43 ms 47 ms 44 ms 43 ms 47.10
quad9 45 ms 52 ms 47 ms 42 ms 47 ms 46 ms 63 ms 52 ms 44 ms 46 ms 48.40
neustar 47 ms 46 ms 56 ms 48 ms 46 ms 58 ms 48 ms 52 ms 45 ms 56 ms 50.20
google 54 ms 45 ms 44 ms 59 ms 53 ms 74 ms 51 ms 75 ms 44 ms 56 ms 55.50
@awwong1
awwong1 / fuck.js
Last active June 19, 2018 05:50
wtf firefox crypto
var pw = window.crypto.getRandomValues(new Uint8Array(16));
window.crypto.subtle.importKey("raw", pw, "PBKDF2", false, ["deriveBits"]).then(key => {
console.log(key);
var st = window.crypto.getRandomValues(new Uint8Array(16));
const keySizeBits = 2048;
// const keySizeBits = 2056; // this breaks
return window.crypto.subtle.deriveBits({ name: "PBKDF2", salt: st, iterations: 10000, hash: "SHA-256" }, key, keySizeBits);
}).then(bits => {
console.log(bits);
}).catch(err => {
const backward = "backward";
const forward = "forward";
let shadowHealth = 20;
class Player {
playTurn(warrior) {
const senseHealth = warrior.health();
const shouldPivot = warrior.feel().isWall();
@awwong1
awwong1 / .block
Last active November 12, 2018 18:49
D3 Workshop: Part 1 - Basic HTML, d3, and Data Binding
license: mit
@awwong1
awwong1 / .block
Last active November 12, 2018 19:35
D3 Workshop: Part 2 - SVGs and d3 Transitions
license: mit
@awwong1
awwong1 / .block
Last active November 12, 2018 20:20
D3 Workshop: Part 3 - Conference Data
license: mit
@awwong1
awwong1 / q_ex.m
Created November 14, 2018 04:51
HHMM paper figure 3 bottom
```
q(:,:,1) = [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
1 1 1 1 1 1 1 2 0 0 0 0 0 0 0 0 0;
1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 2;
1 1 2 1 1 1 1 1 1 2 1 1 1 1 2 0 0];
q(:,:,2) = [8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 5 0 7 0 0 5 0 0 0 0 0 0 0 0 0 0;
0 0 0 3 0 7 0 0 0 0 0 5 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
```
$ ./insyn.py --parse-example --db-offset 0
============== SOURCE CODE ==============
package com.cl.interpolatordebugger;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
@awwong1
awwong1 / hhmm.png
Last active November 19, 2018 19:39
HHMM Example
hhmm.png