Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Hacking the Gibson ...

Cookie Engineer cookiengineer

💭
Hacking the Gibson ...
View GitHub Profile
@cookiengineer
cookiengineer / list.md
Created Jan 30, 2021 — forked from ih2502mk/list.md
Quantopian Lectures Saved
View list.md
@cookiengineer
cookiengineer / etkey.sh
Created Aug 23, 2018
Enemy Territory: Key Generator
View etkey.sh
#!/bin/bash
thisscript=$(readlink -f $0);
mygoto=`dirname $thisscript`;
myhome=$HOME;
FLOOR=99999;
export TZ="GMT";
@cookiengineer
cookiengineer / console-polyfill.js
Last active Nov 5, 2020
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 = '';
/*
* HELPERS
@cookiengineer
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.
https://github.com/firmata/arduino#firmata-client-libraries
@cookiengineer
cookiengineer / Renderer.js
Created Mar 14, 2017
Canvas Renderer with dirty callstack integration
View Renderer.js
lychee.define('Renderer').tags({
platform: 'html'
}).supports(function(lychee, global) {
/*
* XXX: typeof CanvasRenderingContext2D is:
* > function in Chrome, Firefox, IE10
* > object in Safari, Safari Mobile
*/
@cookiengineer
cookiengineer / Brain.js
Last active Jan 4, 2017
Quick 'n dirty Backpropagated Neural Network implementation
View Brain.js
const _LEARNING_RATE = 0.3;
const _LEARNING_MOMENTUM = 0.9;
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 Array.prototype.map.call(string, val => _DICTIONARY[(32 + _DICTIONARY.indexOf(val)) % _DICTIONARY.length]).join('');
};
const _decode_rot32 = function(string) {
return Array.prototype.map.call(string, val => _DICTIONARY[(_DICTIONARY.indexOf(val) - 32 + _DICTIONARY.length) % _DICTIONARY.length]).join('');
};
@cookiengineer
cookiengineer / refactor_po.js
Created Nov 7, 2016
gnome-shell/refactor_po.js Helper script
View refactor_po.js
#!/usr/bin/env node
/*
* XXX: This helper script is for usage with the GNOME Shell fork at
* https://github.com/cookiengineer/gnome-shell
*
* It will refactor "out" all PO translation sections that start with
* any of the filtered entries below.
*/
@cookiengineer
cookiengineer / apt-pac.sh
Last active Jan 22, 2021
APT-PAC - pacman with APT syntax
View apt-pac.sh
#!/bin/bash
# Save this file as /usr/bin/apt-pac and chmod +x it.
case "$1" in
autoremove)
pacman -Rns $(pacman -Qdtq);
;;
View split_bootimg.pl
#!/usr/bin/perl
######################################################################
#
# File : split_bootimg.pl
# Author(s) : William Enck <enck@cse.psu.edu>
# Description : Split appart an Android boot image created
# with mkbootimg. The format can be found in
# android-src/system/core/mkbootimg/bootimg.h
#
# Thanks to alansj on xda-developers.com for