Skip to content

Instantly share code, notes, and snippets.

View Protoneer's full-sized avatar

Bertus Kruger Protoneer

View GitHub Profile
@Protoneer
Protoneer / PySerialCustomeEndLine
Created September 17, 2014 03:00
Serial connect with custom end of line character
import serial,time
ser = serial.Serial('COM1')
ser.write("$$\r\n")
def readline():
eol = b'\r'
leneol = len(eol)
line = bytearray()
while True:
@Protoneer
Protoneer / PWM.ino
Last active August 29, 2015 14:09
PWM for led control. With pot and buttons to adjust brightness
// All the pins needed
int pin_led = 9;
int pin_pot = 0;
int pin_button_mode = 2;
int pin_button_up = 3;
int pin_button_down = 4;
// Button state. 0 = button off , 1 = button pressed in
bool button_mode_state = 1;
bool button_up_state = 1;
@Protoneer
Protoneer / Email2Kanboard.py
Created January 5, 2015 02:16
Kanboard create task from incoming emails
import imaplib
import email
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login('user','password')
mail.list()
# Out: list of "folders" aka labels in gmail.
mail.select("inbox") # connect to inbox.
mail.select('INBOX', readonly=True)
@Protoneer
Protoneer / aliexpress-qty-search-fix.js
Created April 19, 2016 21:39 — forked from sleemanj/aliexpress-qty-search-fix.js
Return the Quantity Search on Aliexpress
// ==UserScript==
// @name Return the Quantity Search
// @namespace https://gist.github.com/sleemanj/95035bf2c0141ac72420
// @updateURL https://gist.github.com/sleemanj/95035bf2c0141ac72420/raw/aliexpress-qty-search-fix.js
// @downloadURL https://gist.github.com/sleemanj/95035bf2c0141ac72420/raw/aliexpress-qty-search-fix.js
// @version 0.1
// @description Put the quantity search fields back into the search interface on Aliexpress when they are not present.
// @author You
// @match http://*.aliexpress.com/*
// @grant none
@Protoneer
Protoneer / nodejs-tcp-example.js
Created June 7, 2016 04:19 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 4
#define NUM_LEDS 16
#define BRIGHTNESS 25
@Protoneer
Protoneer / Blink.ino.hex
Last active July 22, 2016 09:47
2560Test
Install NodeMCU
https://github.com/nodemcu/nodemcu-flasher/blob/master/Win64/Release/ESP8266Flasher.exe?raw=true
-- Connect via serial port
majorVer, minorVer, devVer, chipid, flashid, flashsize, flashmode, flashspeed = node.info();
print(flashsize)
@Protoneer
Protoneer / increment.bat
Created May 22, 2018 02:45 — forked from vurdalakov/increment.bat
Automatically increment version number in Arduino IDE
@echo off
echo ----------------------------------------------- increment.bat script -----------------------------------------------
rem ========================================================================================
rem == This script automatically increments build number in "version.h" file.
rem == Instructions and more information:
rem == http://codeblog.vurdalakov.net/2017/04/autoincrement-build-number-in-arduino-ide.html
rem ========================================================================================
setlocal
<?xml version="1.0" encoding="utf-8"?>
<XmlCoordinate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Leftmark>
<X>36357</X>
<Y>45502</Y>
</Leftmark>
<Rightmark>
<X>36009</X>
<Y>48322</Y>
</Rightmark>