Skip to content

Instantly share code, notes, and snippets.

View creaktive's full-sized avatar
👽
🛸

Stanislaw Pusep creaktive

👽
🛸
View GitHub Profile
@creaktive
creaktive / Pushsafer.pm
Created September 9, 2025 14:26
Pushsafer notifications for Convos DMs
package Convos::Plugin::Pushsafer;
use Mojo::Base 'Convos::Plugin', -signatures;
sub register($self, $app, $config = {}) {
my $ua = $app->ua;
my $key = ...;
my $dev = ...;
my $prio = 0;
my $icon = 33;
@creaktive
creaktive / dyson.sh
Last active September 8, 2025 07:59
#!/usr/bin/env bash
set -euo pipefail
# --- Config ---
DYSON_DEVICE=NN2-EU-XXXXXXXX
DYSON_TOKEN=XXXXXXXXXXXXXXXX
INFLUX_HOST=http://127.0.0.1:8086
INFLUX_ORG=home
INFLUX_BUCKET=climate
@creaktive
creaktive / trainmore.php
Last active August 13, 2025 10:51
TrainMore QR code
<?php
$PUBLIC_FACILITY_GROUP = ...;
$AUTH_TOKEN = ...;
// get QR code data
$ch = curl_init('https://my.trainmore.nl/nox/v1/customerqrcode/');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_HTTPHEADER => [
@creaktive
creaktive / base32.js
Created January 30, 2025 20:30
Base32 in pure JavaScript
const BASE32_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
function encodeBase32(input) {
const buffer = Buffer.from(input);
let bits = 0;
let value = 0;
let output = '';
for (let i = 0; i < buffer.length; i++) {
value = (value << 8) | buffer[i];
@creaktive
creaktive / psy-radio.m3u
Created August 19, 2024 09:29
Psytrance Online Radios
#EXTM3U
#EXTINF: 0, Psyndora Trance
https://cast.magicstreams.gr/sc/psyndora/stream
#EXTINF: 0, Psyndora Chill
https://cast.magicstreams.gr/sc/psychill/stream
#EXTINF: 0, RadiOzora Trance
https://trance.out.airtime.pro/trance_a
@creaktive
creaktive / sfjq.sh
Last active March 28, 2024 20:01
jq <3 SalesForce
alias sfjq='jq '\''if .status==0 then .result.records[]|[paths(scalars) as $p|{"key":$p|join("."),"value":getpath($p)}|select(.key|test("\\battributes\\b")|not)]|from_entries else .message|halt_error(1) end'\'
@creaktive
creaktive / amazon-ip-ranges.pl
Created March 5, 2024 13:14
AWS IP address ranges scanner
#!/usr/bin/env perl
use strict;
use warnings qw(all);
use constant IP_RANGES_JSON => 'https://ip-ranges.amazonaws.com/ip-ranges.json';
use JSON::PP qw();
use LWP::Simple qw();
use NetAddr::IP qw();
@creaktive
creaktive / cheat.sh
Last active September 7, 2025 13:30
New York Times Spelling Bee cheat
# try to guess the words for the given letters based on the scrapped dictionary
perl -ane '$_=lc;/^[acznito]{4,}$/&&/o/&&print' "$HOME/spelling-bee.txt" | sort -u
@creaktive
creaktive / parser.pl
Created May 16, 2023 18:22
iTerm2 color scheme parser
#!/usr/bin/env perl
use 5.036;
local $/ = undef;
$_ = <>;
while (
m{
(?(DEFINE)
(?<float> \d+\.\d+)
@creaktive
creaktive / midi.pl
Created December 3, 2022 14:16
simplest MIDI file writer
#!/usr/bin/env perl
use 5.036;
my $ch = 0;
my $division = 960;
my $note_off = 0x80;
my $note_on = 0x90;
my $track = '';
$track .= pack('wC3', 23, $note_on + $ch, 69, 126);