Skip to content

Instantly share code, notes, and snippets.

@eendeego
eendeego / Gruntfile.js
Created July 5, 2013 16:57
How to delay responses on connect middleware, eg, to test timeouts, on a yeoman's generated gruntfile.
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// ...
@eendeego
eendeego / npm.log
Last active December 25, 2015 10:59
npm output installing hawk on raspberry pi
$ npm install --loglevel silly -g hawk
npm info it worked if it ends with ok
npm verb cli [ '/home/pi/work/share/node-official/node-v0.10.19-linux-arm-pi/bin/node',
npm verb cli '/home/pi/work/share/node-official/node-v0.10.19-linux-arm-pi/bin/npm',
npm verb cli 'install',
npm verb cli '--loglevel',
npm verb cli 'silly',
npm verb cli '-g',
npm verb cli 'hawk' ]
npm info using [email protected]
@eendeego
eendeego / A-Pen-by-Luis-Reis.markdown
Created January 6, 2014 19:16
A Pen by Luis Reis.
var known = [ 1, 6, 3, 9, 4 ];
var presented = [ 2, 5, 7, 4, 9, 4 ];
function done(missing, extraneous) {
console.log('Missing:', missing);
console.log('Extraneous:', extraneous);
}
check(known, presented, done);
@eendeego
eendeego / install-texy-1.8.txt
Created July 29, 2014 00:36
Install texy's raspberry pi TFT 1.8 screen with current adafruit/notro drivers
# https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/software-installation
mkdir -p ~/work/share/adafruit-pitft-2.8
cd ~/work/share/adafruit-pitft-2.8
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb
@eendeego
eendeego / texy-1.8.sh
Last active June 30, 2019 16:04
Install adafruit lcd drivers on texy's 1.8 tft display (raspberry pi)
## Install kernel modules
mkdir -p ~/work/share/lcd/adafruit-pitft-2.8
cd ~/work/share/lcd/adafruit-pitft-2.8
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb
wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-20140724-1.deb
@eendeego
eendeego / promisifyREPLServer.js
Created September 2, 2014 20:56
promisify repl server
function promisify(server) {
var _eval = server.eval;
server.eval = function promisifiedEval(cmd, context, filename, callback) {
_eval(cmd, context, filename, function (err, result) {
if (err) {
callback(err);
return;
}
Promise.resolve(result).then(function (result) {
@eendeego
eendeego / .gitignore
Last active August 29, 2015 14:07
D3 Moran Model Simulator
We couldn’t find that file to show.
@eendeego
eendeego / notes.txt
Last active April 13, 2018 15:01
Random Raspberry Pi TFT Notes
---------------------------------------------
2014-07-27 - Texy / Adafruit - 1.8" SPI TFT display, 160x128 18-bit color - ST7735R driver (LCD/TFT)
# http://www.adafruit.com/products/618
# http://www.adafruit.com/products/358
# http://www.raspberrypi.org/forums/viewtopic.php?f=64&t=40677 - 1.8 TFT LCD add-on shield board
# http://www.raspberrypi.org/forums/viewtopic.php?f=59&t=43286 - 1.8" TFT LCD Shield board v2
# http://www.raspberrypi.org/forums/viewtopic.php?f=93&t=43286&p=396430#p396430 - "switching the backlight on and off works!"
"I removed the connectors of pins 15 and 16 between the TFT board and the shield board, rewired pin 15 to the 3.3V rail, and pin 16 to collector in a standard NPN transistor. Base of this transistor is connected to a free GPIO out and emitter goes to GND."
# http://minhdanh2002.blogspot.pt/2013/11/experimenting-with-st7735-18-128x160.html - LCD board pinout
# http://www.raspberrypi.org/forums/viewtopic.php?t=40677 - Este tem os botões !!
(function () {
const originalPrimaryColor = document.querySelector('.xl.light').style.color; //'rgb(178, 178, 178)';
const secondaryColor = [...document.querySelectorAll('path')]
.map(c => c.computedStyleMap().get('stroke').toString())
.find(f => f != 'none' && f != originalPrimaryColor); //'rgb(126, 95, 50)';
const originalFadedColor = document.querySelector('.lc.s').style.color; //'rgb(229, 229, 229)';
const backgroundColor = document.body.style.backgroundColor; // "rgb(125, 90, 37)"
const newPrimaryColor = 'rgb(0, 0, 0)';
const newSecondaryColor = 'rgb(192, 192, 192)';