Skip to content

Instantly share code, notes, and snippets.

Hacking the Gibson ...

Cookie Engineer cookiengineer

Hacking the Gibson ...
Block or report user

Report or block cookiengineer

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
cookiengineer /
Last active Jan 24, 2019
Chromium/Gecko Bug when using instanceof operator across iframes

instanceof operator corruption when transferring arrow functions across iframes

Test Case Architecture

The idea is to have two different html files to communicate with each other, whereas the index.html symbolizes the main program and has APIs that are accessible inside the iframe via window.parent as the origin and other CORS relevant headers are correctly set.

cookiengineer /
Created Aug 23, 2018
Enemy Territory: Key Generator
thisscript=$(readlink -f $0);
mygoto=`dirname $thisscript`;
export TZ="GMT";
cookiengineer / console-polyfill.js
Last active Dec 12, 2019
A better console API for node.js, with support for all data types and pretty-printing using shell color codes
View console-polyfill.js
(function() {
let _std_out = '';
let _std_err = '';
cookiengineer / 01-install-lycheejs.original.cast
Last active Aug 25, 2018
Shrink asciinema cast files and auto-shorten/auto-cut them accordingly.
View 01-install-lycheejs.original.cast
{"version": 2, "width": 80, "height": 24, "timestamp": 1531123077, "idle_time_limit": 2.5, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}, "title": "Install lychee.js"}
[0.034539, "o", "\u001b]0;cookiengineer@wuup:~\u0007\u001b]7;file://wuup/home/cookiengineer\u0007"]
[0.039619, "o", "\r\n[\u001b[32m✔\u001b[0m]─[\u001b[01;49;39mcookiengineer@wuup\u001b[0m]─[\u001b[01;49;39m/home/cookiengineer\u001b[0m]\r\n[$] "]
[1.614263, "o", "sudo bash -c \"$(curl -fsSL\";\r\n"]
[1.836818, "o", "[sudo] password for cookiengineer: "]
[6.998831, "o", "\r\n"]
[7.070439, "o", " (L) \r\n\u001b[37m\u001b[42m (I) lychee.js Git/Net Installer \u001b[0m\r\n (L) \r\n"]
[7.070518, "o", " (L) This installer downloads and installs lychee.js. \r\n (L) The installation target folder is /opt/lycheejs \r\n (L) \r\n"]
[7.07055, "o", " (L) Download size is ~50MB + ~700MB + dependencies. \r\n"]
[7.070822, "o", " (L) Installation size is ~2.0GB. \r\n (L) \r\n (L) Continue (y/n)? "]
cookiengineer / StandardFirmataPlus.ino
Created May 9, 2017
Standard Firmata Plus firmware backup for Johnny Five
View StandardFirmataPlus.ino
Firmata is a generic protocol for communicating with microcontrollers
from software on a host computer. It is intended to work with
any host computer software package.
To download a host software package, please click on the following link
to open the list of Firmata client libraries in your default browser.
cookiengineer / Renderer.js
Created Mar 14, 2017
Canvas Renderer with dirty callstack integration
View Renderer.js
platform: 'html'
}).supports(function(lychee, global) {
* XXX: typeof CanvasRenderingContext2D is:
* > function in Chrome, Firefox, IE10
* > object in Safari, Safari Mobile
cookiengineer /
Created Jan 13, 2017
Shell script to backup git repositories (and their HEAD branches) and tar.gz them
# XXX: This shell script temporarily creates the ./$orga/$repo folder structure
# XXX: This shell script persistently creates the ./$orga/$repo.tar.gz structure
ROOT_FOLDER=$(cd "$(dirname "$0")"; pwd);
_backup_repository() {
cookiengineer / fix_repos.js
Created Jan 7, 2017
Fix repos' update hooks of gitea service (which was moved around)
View fix_repos.js
#!/usr/bin/env node
// XXX: This file MUST BE in the same folder as gitea.
// if "/opt/gitea/gitea web" starts the service
// then "/opt/gitea/fix_repos.js" is this file
// and "/opt/gitea/gitea-repositories" is the repos folder (default location)
const _fs = require('fs');
const _ROOT = __dirname;
cookiengineer / Brain.js
Last active Jan 4, 2017
Quick 'n dirty Backpropagated Neural Network implementation
View Brain.js
const _LEARNING_RATE = 0.3;
const _random = function() {
return (Math.random() * 2) - 1;
const Brain = function(network) {
View rot32.js
const _DICTIONARY = new Array(96).fill('').map((a,v) => String.fromCharCode(32 + v));
const _encode_rot32 = function(string) {
return, val => _DICTIONARY[(32 + _DICTIONARY.indexOf(val)) % _DICTIONARY.length]).join('');
const _decode_rot32 = function(string) {
return, val => _DICTIONARY[(_DICTIONARY.indexOf(val) - 32 + _DICTIONARY.length) % _DICTIONARY.length]).join('');
You can’t perform that action at this time.