Skip to content

Instantly share code, notes, and snippets.

View mStirner's full-sized avatar

Marc Stirner mStirner

View GitHub Profile
@mStirner
mStirner / Github Webhook Tutorial.md
Created September 14, 2025 17:24 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@mStirner
mStirner / README.md
Created December 11, 2024 19:46
HTML/CSS Drag & Resziable element.

This gist allows to define a css grid system where elements can be positioned inside. E.g. Dashboard widget arrangement.

Add a dragable element, resize it, position where ever you want.

Screenshot 2024-12-11 at 20-45-55 Grid Draggable   Resizable Element

@mStirner
mStirner / RPi3-Auto-WiFi.md
Created February 19, 2024 14:55 — forked from carry0987/RPi3-Auto-WiFi.md
Raspberry Pi 3B+ Auto reconnect to wifi when lost connect

Auto reconnect to wifi when lost connect

Create script file

Use touch /home/pi/wifi-reconnect.sh to create shell script file, with following content:

#!/bin/bash 
 
SSID=$(/sbin/iwgetid --raw) 
@mStirner
mStirner / cron.js
Created May 5, 2023 15:20 — forked from shimondoodkin/cron.js
javascript cron can be used in node.js
/*
Added complex matches by Shimon Doodkin 2012
Developed by Elijah Rutschman 2009 - http://elijahr.blogspot.com/2009/03/javascript-cron.html
*/
/*
a typical cron entry has either wildcards (*) or an integer:
.---------------- minute (0 - 59)
| .-------------- hour (0 - 23)
| | .------------ day of month (1 - 31)
@mStirner
mStirner / tunejack.sh
Created March 7, 2023 09:40 — forked from xndc/tunejack.sh
Instant radio streaming script using the TuneIn API
#!/bin/bash
# tunejack.sh uses the TuneIn public API (at opml.radiotime.com) to search for
# a radio station, print out its details and try to play it somehow.
if [ "$#" -eq 0 ]; then
echo "$0: search for a radio station using the TuneIn API"
echo "Usage: $0 PATTERN"
exit 1
fi
@mStirner
mStirner / adapter.js
Created April 26, 2022 19:47
WebSocket l4 adapter minimal reproducible example
const { Transform } = require("stream");
module.exports = () => {
let encode = new Transform({
transform(chunk, encoding, cb) {
console.log("[encode]", chunk);
cb(null, chunk);
@mStirner
mStirner / README.md
Last active March 20, 2022 21:21
Lightweight, stream based, expandable, node.js logger with zero dependencies

This is a example of a very lightweight, stream based, node.js logger. It creates a "record" object for each log call, and pipe it throught the spicified streams. In the streams its possible to modifie the record, format the message, and many more.

Bunyan, there is no one responding on issues, Winstons is way to big and have unecesseray dependencies.

I wanted a lightweight, easy to use, expandable, stream based, logging utily with zero dependencies. You can all merge this down into a single file. You bascily need class.logger.js & levels.js which can simple merged into a single file.

The other files (demo.js, formatter.js) are for demonstration & formatting and not needed for the functionality.

@mStirner
mStirner / fingerprint.js
Created March 29, 2020 22:29
canvas fingerprint
var makeCRCTable = function(){
var c;
var crcTable = [];
for(var n =0; n < 256; n++){
c = n;
for(var k =0; k < 8; k++){
c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
}
crcTable[n] = c;
}
@mStirner
mStirner / README.md
Created March 22, 2020 00:51
*tgz verification (for signed plugins)
  • Quick & dirty tar.gz/.tgz verification
  • add extra header filed
  • sub header contains:
    • Author information (email & name)
    • Signature from server (public + private key)

lib coming soon...

const events = require("events").EventEmitter;
/*
Added complex matches by Shimon Doodkin 2012
Developed by Elijah Rutschman 2009 - http://elijahr.blogspot.com/2009/03/javascript-cron.html
*/
/*
a typical cron entry has either wildcards (*) or an integer: