Skip to content

Instantly share code, notes, and snippets.

View SchizoDuckie's full-sized avatar

SchizoDuckie

  • The Hague
View GitHub Profile
#include "Adafruit_VL53L1X.h"
#include "EspMQTTClient.h"
EspMQTTClient client(
"YOUR_WIFI_NAME",
"YOUR_WIFI_PASSWORD",
"atticstairleds.local", // MQTT Broker server ip or hostname
NULL, // Can be omitted if not needed
NULL, // Can be omitted if not needed
"sensor-upstairs", // Client name that uniquely identify your device
/**
* ---------------------------------------------------------
* | Esp-32/Arduino Stair Led Relay control |
* | By SchizoDuckie, ©2019 |
* | |
* | Disclaimer: |
* | I am in no way, shape or form responsible for |
* | - You setting your house on fire |
* | - Your firstborn suddenly getting autism |
* | - Your girlfriend running off with the neighbour |
@SchizoDuckie
SchizoDuckie / keybase.md
Created January 9, 2019 08:58
proving myself

Keybase proof

I hereby claim:

  • I am schizoduckie on github.
  • I am schizoduckie (https://keybase.io/schizoduckie) on keybase.
  • I have a public key ASC-RaPjtlfuI-IWqq1_73SOGJ81KYFgQfJ4E5Gu-tQt3go

To claim this, I am signing this object:

@SchizoDuckie
SchizoDuckie / lexos.js
Created July 5, 2016 23:26
lexos minified
/*! BvS-LexOS - v1.0.0 - built: Thursday, March 31st, 2016, 2:20:34 PM */ ! function a(b, c, d) {
function e(g, h) {
if (!c[g]) {
if (!b[g]) {
var i = "function" == typeof require && require;
if (!h && i) return i(g, !0);
if (f) return f(g, !0);
var j = new Error("Cannot find module '" + g + "'");
throw j.code = "MODULE_NOT_FOUND", j
}
[{
"className": "row",
"fieldGroup": [{
"key": "name",
"type": "input",
"templateOptions": {
"required": true,
"label": "Search Engine Name",
"type": "text"
},
@SchizoDuckie
SchizoDuckie / build_mac.sh
Created July 7, 2015 20:55
Build an OSX .pkg installer from Linux using mkbom and xar
#!/bin/bash
# change the values below to match your system.
# target the BUILD_DIR to output from an nw.io build process. nwjs-shell-builder recommended!
# https://github.com/Gisto/nwjs-shell-builder
# BASE_DIR is the target directory for this script, where files will be gathered and packaged to
BUILD_DIR=”/var/www/deploy/TMP/osx-ia32/latest-git”
BASE_DIR=”/var/www/deploy/osx” 
@SchizoDuckie
SchizoDuckie / deps
Created July 7, 2015 20:46
dependencies for build_osx.sh
git clone https://github.com/hogliux/bomutils && cd bomutils && make && sudo make install
sudo apt-get install libxml2-dev libssl-dev
wget https://xar.googlecode.com/files/xar-1.5.2.tar.gz && tar -zxvf ./xar-1.5.2.tar.gz && cd ./xar-1.5.2 && ./configure && make && sudo make install
@SchizoDuckie
SchizoDuckie / FavoritesService.js
Created November 26, 2014 22:25
Le glorious refactoring of FavoritesService in DuckieTV
/**
* Refactored: 52 lines
*/
addFavorite: function(data, watched) {
watched = watched || [];
console.log("FavoritesService.addFavorite!", data, watched);
return service.getById(data.tvdb_id).then(function(serie) {
if (!serie) {
serie = new Serie();
@SchizoDuckie
SchizoDuckie / DuckieTV-Huge.backup
Last active August 29, 2015 14:01
A huge 5.6mb sqlite database created by DuckieTV after you import this to test the limits of the extensions permissions system
{
"settings": {
"0.42.orphancheck": "done",
"0.4migration": "done",
"0.5.firetimers": "done",
"0.53.createtimers": "true",
"0.5firetimers": "done",
"runtime.event": "{\n \"previousVersion\": \"0.53\",\n \"reason\": \"update\"\n}",
"userPreferences": "{\n \"topSites.enabled\": true,\n \"torrenting.enabled\": true,\n \"torrenting.searchprovider\": \"ThePirateBay\",\n \"torrenting.searchbox\": true,\n \"torrenting.searchquality\": \"HDTV\",\n \"thepiratebay.mirror\": \"https://thepiratebay.se\",\n \"series.displaymode\": \"poster\",\n \"calendar.large\": false,\n \"ChromeCast.localIpAddress\": \"192.168.56.1\",\n \"calendar.mode\": \"date\",\n \"calendar.startSunday\": true\n}",
/**
* Turn a simplexml document in simple array key/values
*/
function simplexml_to_array($xml) {
$output = array();
foreach($xml->children() as $tagname => $value) { // recurse the child
$child = simplexml_to_array($value); // if it's not an array, then it was empty, thus a value/string
if( count($child) == 0 ) $child = (string)$value;
foreach( $value->attributes() as $ak => $av ) { // add the childs attributes as if they where children