-
Reproduce; verify problem
(not estimatable; can only set a maximum cut-off time based on pain/worth)in other words, if you could capture errors at the moment they happen (client-side error reporting),
as well as the steps that led up to them (user behavior analytics, determinism, demo recording),
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const orderedSet = ['6','7','8','9','10','V','D','K','T']; | |
const nextAbove = c => | |
orderedSet[orderedSet.indexOf(c) + 1]; | |
let moveHistory = []; | |
const analyze = (state) => { | |
let moves = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _idpX509Cert = _.get(resp, ['samlp:Response', 'Assertion', 0, | |
'ds:Signature', 0, 'KeyInfo', 0, 'ds:X509Data', 0, 'ds:X509Certificate', 0]); | |
const asn1js = require('asn1js'); | |
const pkijs = require("pkijs"); | |
const Certificate = pkijs.Certificate; | |
const buf = new Buffer(_idpX509Cert, 'base64').buffer; | |
console.log('_idpX509Cert', _idpX509Cert); | |
const asn1 = asn1js.fromBER(buf); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use information_schema; | |
select | |
tables.table_name, | |
statistics.index_name, | |
statistics.cardinality, | |
tables.table_rows | |
from tables | |
join statistics | |
on (statistics.table_name = tables.table_name | |
and statistics.table_schema = '<YOUR DATABASE NAME HERE>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup debugging with Xdebug | |
# apt wont install for php5.2, so build | |
cd /tmp | |
wget http://xdebug.org/files/xdebug-2.1.4.tgz | |
tar zxvf xdebug-2.1.4.tgz | |
cd xdebug-2.1.4/ | |
sudo apt-get install php5-dev | |
phpize | |
./configure | |
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup db | |
sudo -i | |
apt-get install postgresql-8.4 | |
vim /etc/postgresql/8.4/main/pg_hba.conf | |
# change line 82 to read: | |
local all all md5 | |
# insert after line 84, replacing with your actual LAN ip outside the vm: | |
host all all 10.1.10.65/32 md5 | |
:wq | |
vim /etc/postgresql/8.4/main/postgresql.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh REMOTE-SERVER.COM "mysqldump -uroot -p REMOTE_DB | gzip -c" | gunzip | mysql -uroot LOCAL_DB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo to unload, combine on same line: | |
echo pactl unload-module # to unload | |
pactl load-module module-loopback; #latency_msec=1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avg = (a) -> | |
sum = 0 | |
for v in a | |
sum += v | |
sum / a.length | |
cavg = (v, av, c) -> | |
av + ((v - av) / c) | |
console.log '---' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wrap = (list, test, cb) => { | |
const stack = []; | |
let start, end, lastTest, result, lastItem, item, out; | |
for (let i=0,len=list.length; i<len; i++) { | |
item = list.splice(i,1)[0]; | |
result = test(item, lastItem); | |
if ((!result && lastTest !== result) || (i === list.length-1 && lastTest === result)) { | |
out = cb(item, i, start, end, stack, lastItem); | |
if (null != out) { | |
list.splice(i, 0, ...out); |