Skip to content

Instantly share code, notes, and snippets.

View corecode's full-sized avatar

Simon Schubert corecode

View GitHub Profile
import enum
import struct
from pymodbus.client.sync import ModbusSerialClient
from pymodbus.payload import BinaryPayloadBuilder, BinaryPayloadDecoder
class Coil(enum.IntEnum):
ISTATE = 0x0510
class Reg(enum.IntEnum):
void draw_element(int recurse, int max_recurse) {
if (recurse == max_recurse) {
line(0,0,1,0);
} else {
pushMatrix();
scale(1/3.0);
draw_element(recurse+1, max_recurse);
translate(1, 0);
rotate(PI/3.0);
#include "dwt_timer.h"
#define BITLEN_HIGH_0 0
#define BITLEN_HIGH_1 50
#define BITLEN_LOW_0 50
#define BITLEN_LOW_1 40
struct sk6812_base {
// ==UserScript==
// @name USDA Nutrition database scroll fix
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Removes artificial scroll on the USDA Nutrition database food results
// @author Simon Schubert <2-gist@0x2c.org>
// @match https://ndb.nal.usda.gov/ndb/foods/show/*
// @grant none
// ==/UserScript==
#include <Wire.h>
#include <scpi.h>
#include <Servo.h>
#define SCPI_INPUT_BUFFER_LENGTH 256
#define SCPI_ERROR_QUEUE_SIZE 17
#define SCPI_IDN1 "BITS AND ELECTRONS"
#define SCPI_IDN2 "SERVO OUTPUT"
#define SCPI_IDN3 NULL
#define SCPI_IDN4 "0.1"
#include <Wire.h>
#include <scpi.h>
#define SCPI_INPUT_BUFFER_LENGTH 256
#define SCPI_ERROR_QUEUE_SIZE 17
#define SCPI_IDN1 "BITS AND ELECTRONS"
#define SCPI_IDN2 "SCPI TEMPLATE"
#define SCPI_IDN3 NULL
#define SCPI_IDN4 "0.1"
// ==UserScript==
// @name MyFitnessPal Percentages and Net Carbs
// @version 1.14
// @namespace surye
// @description Adds display of Carb/Protein/Fat percentages to any daily food diary page. Also adds "Real Calories" calcalation based off 4/4/9 algorithm. Based on "MyFitnessPal Percentages and Net Carbs"
// @downloadURL https://github.com/Surye/mfp-keto-userscript/raw/master/mfpketo.user.js
// @include http*://www.myfitnesspal.com/food/diary*
// ==/UserScript==
Info : Padding image section 0 with 21940 bytes
Error: flash write algorithm aborted by target
Error: flash write failed at address 0x8002c02
Error: flash memory not erased before writing
Error: error writing to flash at address 0x08000000 at offset 0x00002000
// ==UserScript==
// @name Aliexpress URL Cleaner
// @run-at document-start
// @namespace
// @description Clean aliexpress item URL
// @match *://*.aliexpress.com/item/*
// @match *://*.aliexpress.com/store/product/*
// @version 1.2
// ==/UserScript==
modified pcbnew/class_netclass.cpp
@@ -102,7 +102,7 @@ bool NETCLASSES::Add( NETCLASSPTR aNetClass )
if( name == NETCLASS::Default )
{
// invoke operator=(), which is currently generated by compiler.
- GetDefault() = aNetClass;
+ m_default = aNetClass;
return true;
}