Skip to content

Instantly share code, notes, and snippets.


Wim Mostmans Sitebase

View GitHub Profile
Everlanders /
Created Mar 13, 2018
Headlight and Reverse Lights monitor for YouTube Commenters - UNTESTED but should work fine.
# A quick hack of my button monitor script to monitor headlights and reverse lights to
# Dim the screen and switch to the reverse camera.
# I have not tested this...
# Remember, the switch or opto is switching to ground, so the logic is inverted... 0 = on 1 = off
# Also, you would run only one of these "Monitor" scripts. you can't be running AND
import RPi.GPIO as GPIO
import time
import subprocess, os
iampeter / gist:5af9c9e113e41c954364
Last active Apr 14, 2020
Simple proxy with hapi.js to fix your CORS problems
View gist:5af9c9e113e41c954364


While building a JavaScript single page app that acts as a front-end to multiple backend servers, even if they are on the same host as the web app - but on different ports, you come across CORS issues.


Use a simple node.js + hapi.js server to:

  1. Serve your static single page app
  2. Act as proxy to the backend servers
raine /
Last active Aug 3, 2018
Read heroku log output with bunyan

Read heroku logs output w/ bunyan

The stuff before the JSON in heroku logs output has to be cut off for bunyan to work.

$ heroku logs | sed -l 's/.*app\[web\..*\]\: //' | bunyan

Flag -l makes the output buffered by line.

s-panferov / class_manager.ts
Last active Aug 29, 2015
BEM ClassManager
View class_manager.ts
module classes {
export interface ClassManager {
mod( string[]): ClassManager;
cmod(condition: boolean, string[]): ClassManager;
toString(): string;
before(...other: ToString[]): ClassManager;
after(...other: ToString[]): ClassManager;
staltz /
Last active May 15, 2021
The introduction to Reactive Programming you've been missing
nickytoh / iCloud API Demo in Node.js
Last active Aug 8, 2018
Request Contact List From iCloud
View iCloud API Demo in Node.js
var uuid = require('node-uuid'),
https = require('https');
function iCloud(appleId, password) {
this.urls = {
"version" : "",
"validate": "/setup/ws/1/validate?clientBuildNumber={0}&clientId={1}",
"login": "/setup/ws/1/login?clientBuildNumber={0}&clientId={1}"
stephen / eventTester.js
Created May 11, 2014
node-sonos eventing framework
View eventTester.js
var Sonos = require('../index').Sonos;
var Listener = require('../lib/events/listener');
var x = new Listener(new Sonos(process.env.SONOS_HOST || ''));
x.listen('/ZoneGroupTopology/Event', function(err, sid) {
shubik / gist:10955038
Created Apr 17, 2014
requirejs onBuildWrite to remove jsx!
View gist:10955038
onBuildWrite: function (moduleName, path, contents) {
return contents.replace(/jsx!/g, '');
mikhailov / gist:9639593
Last active Apr 20, 2021
Nginx S3 Proxy with caching
View gist:9639593
events {
worker_connections 1024;
http {
default_type text/html;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
harith /
Last active Nov 8, 2018
Utilities to let you easily reach frequently visited but deeply nested directories.
# Utilities for quickly accessing frequently used directories in bash.
# Usage:
# $ cd /path/to/project/src/
# $ mark code # Will create a new shortcut.
# # Becomes interactive if a shortcut already exists
# # m is an alias for mark. You can also `m code`
# $ code # From now on, running this anywhere in the shell
# # will put you in /path/to/project/src/code