Skip to content

Instantly share code, notes, and snippets.

@SunboX
SunboX / qChecksum.md
Created December 15, 2022 08:47
Qt qChecksum implementation in Node.js / JavaScript

I thought this might be helpful for someone some time:

const crc_tbl = [
    0x0000, 0x1081, 0x2102, 0x3183,
    0x4204, 0x5285, 0x6306, 0x7387,
    0x8408, 0x9489, 0xa50a, 0xb58b,
    0xc60c, 0xd68d, 0xe70e, 0xf78f
]
// Wir müssen diese Bibliotheken mittels Bibliotheksmanager installieren
#include <WiFi.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
#include <FastLED.h>
// Anzahl der "NeoPixel"
#define NUM_PIXELS 12
@SunboX
SunboX / README.md
Created September 18, 2020 07:19 — forked from manuelbl/README.md
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
(function(){if (!Date.now) Date.now = function() {
return +new Date;
};
try {
document.createElement("div").style.setProperty("opacity", 0, "");
} catch (error) {
var d3_style_prototype = CSSStyleDeclaration.prototype,
d3_style_setProperty = d3_style_prototype.setProperty;
d3_style_prototype.setProperty = function(name, value, priority) {
d3_style_setProperty.call(this, name, value + "", priority);
import * as Git from "nodegit";
const signature = Git.Signature.create("Foo bar", "[email protected]", 123456789, 60); // http://www.nodegit.org/api/signature/
const files: string[] = [path.resolve(__dirname, "./tmp/xxxx/file1.ts"), path.resolve(__dirname, "./tmp/xxxx/file2.ts")];
// open repository - maybe not necessary, because you already have a reference
//let repo = await Git.Repository.open(path.resolve(__dirname, "./tmp/xxxx/.git"));
// Create a new branch on head
@SunboX
SunboX / gist:4079cda2ec490ac79f05dcc8eef56d82
Created March 28, 2018 06:40 — forked from kevinhooke/gist:d2eabbd402741ae728ef6ab2985dfddd
Using Docker on Windows with Cisco AnyConnect VPN in non-split tunnel mode
Start docker before connecting vpn (to get local ip, eg 192.168.99.100)
After start, connect to VPN, then follow next steps:
From: https://github.com/boot2docker/boot2docker/issues/628
Add port forwarding to the NAT'd adapter in VirtualBox, add:
docker: host=127.0.0.1 port=2367 guest ip=[blank] guest port=2376
container port: 127.0.0.1, port=[the container exposed port to forward] guest ip=[blank], guest port[container port]
From https://www.iancollington.com/docker-and-cisco-anyconnect-vpn/
In Docker Quickstart Terminal, to point to port forwarded Docker, and to turn off checking of SSL certs:
@SunboX
SunboX / corporate-linux-desktop-howto.md
Created January 15, 2018 14:09 — forked from jtyr/corporate-linux-desktop-howto.md
How to run Linux desktop in a corporate environment

How to run Linux desktop in a corporate environment

DISCLAIMER

Some of the practices described in this HOWTO are considered to be illegal as they often break internal corporate policies. Anything you do, you do at your own risk.

@SunboX
SunboX / enpointExample.groovy
Created January 5, 2018 21:28 — forked from aurman/enpointExample.groovy
SmartThings API Endpoint Example
/**
* App Endpoint API Access Example
*
* Author: SmartThings
*/
preferences {
section("Allow Endpoint to Control These Things...") {
input "switches", "capability.switch", title: "Which Switches?", multiple: true
input "locks", "capability.lock", title: "Which Locks?", multiple: true
@SunboX
SunboX / exampleOauth.php
Created January 5, 2018 21:28 — forked from aurman/exampleOauth.php
SmartThings .php example authenticating and controlling SmartThings API endpoints
<?php
//client id and client secret
$client = '';
$secret = '';
//hardcode the full url to redirect to this file
$url = "";
//STEP 1 - Get Access Code
@SunboX
SunboX / gist:3ad98781eab0e9d34585ec01d96994ec
Created November 19, 2017 20:11 — forked from bruth/gist:2865951
Backbone Sync Queue
# Reference Backbone ajax function
_ajax = Backbone.ajax
requestQueue = []
requestPending = false
sendRequest = (options, promise, trigger=true) ->
options = _.clone options
if trigger
requestPending = true