Skip to content

Instantly share code, notes, and snippets.

View tecteun's full-sized avatar
💭
🤠

tecteun

💭
🤠
View GitHub Profile
@tecteun
tecteun / buildJson_Macro.hx
Last active January 31, 2019 23:17
buildJson macro, dynamically builds type from json in package config.*, autocomplete your json son!
import haxe.macro.Context;
import haxe.macro.Expr;
class Macro {
macro public static function buildJson(config_path:String, ?name:String = "JsonConfig"):Array<Field>{
var config_field_name = "data";
var config = null;
var traverse:Dynamic->?Null<Array<haxe.macro.Field>>->ComplexType = null;
@tecteun
tecteun / arduino.service
Last active June 2, 2018 22:19
Arduino IDE remote upload configuration, network tcp upload bridge to leonardo connected to rpi
<!-- file: /etc/avahi/services/arduino.service -->
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">'%h' arduino bridge</name>
<service>
<type>_arduino._tcp</type>
<!-- port value not actually used when ssh_upload=yes -->
<port>22</port>
<txt-record>board=leonardo</txt-record>
@tecteun
tecteun / qifei.lua
Created May 12, 2016 20:54
Qifei 4-bit LED Digital Tube Module, NodeMCU ESP8266
--Cheap tube module, code for ESP8266 NodeMCU
--depends on ntp.lua
--https://gist.github.com/lucsmall/66d9b6539df7a0daa569
--http://www.esp8266.com/viewtopic.php?p=12733
--http://forum.43oh.com/topic/8596-4-digit-display-from-qifei/
--Qifei 4-bit LED Digital Tube Module, aka 74HC595
--
--D7 -> DIO
--D5 -> sclk
--D4 -> rclk
@tecteun
tecteun / timtamlottery.js
Last active March 4, 2016 09:37 — forked from thepauljones/timtamlottery.js
Open sourced code to determine who in the team gets the overige tim tams after everyone has had one
var totalTimTamsinPack = 8; //For the Hellema brand
var people = ["fardau", "wilfred", "jeroen", "teun", "arjan", "erik", "paul"];
var usecrypto = true;
var timtamsleftAfterEveryoneGetsOne = totalTimTamsinPack - people.length;
var array = new Uint32Array(1);
while(timtamsleftAfterEveryoneGetsOne-- > 0){
var winer = null;
if(usecrypto){
window.crypto.getRandomValues(array);