Skip to content

Instantly share code, notes, and snippets.

Revoltech plugnburn

Block or report user

Report or block plugnburn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@plugnburn
plugnburn / Novocarina.scad
Last active Oct 13, 2019
Novocarina: 3D-printable customizable English pendant style ocarina
View Novocarina.scad
This file has been truncated, but you can view the full file.
/**
* Novocarina: a fully 3D-printable ocarina with a side pendant loop and customizable inside bottom branding
* Optimized PLA settings: 20% infill, 0.3mm layer height, 10mm brim
*
* Key: C
*
* It has some differences from a standard 4-hole English pendant system ocarina:
* due to the nature of 3D printing in PLA, some tones actually have different keying
* (don't believe your musical tuners since they can't pick up any overtones,
@plugnburn
plugnburn / stl2scad.js
Last active Oct 11, 2019
STL2SCAD.js - Optimizing decompiler of a binary STL into the OpenSCAD source
View stl2scad.js
/**
* Optimizing decompiler of a binary STL into the OpenSCAD polyhedron module
* @license Unlicense
*
* @param {ArrayBuffer} stl STL file contents (binary flavor)
* @param {string} optional custom name for OpenSCAD object (if none passed then 'object{NumTriangles}' will be used)
* @returns {string} ready OpenSCAD script
*/
function STL2SCAD(stl, optModName = null) {
var totalTriangles = new Uint32Array(stl.slice(80, 84))[0], //triangle amount is LE uint at byte 80
@plugnburn
plugnburn / libwallace.js
Last active Oct 11, 2019
LibWallace: toolbox library for Qualcomm-based phones running KaiOS
View libwallace.js
/**
* LibWallace: toolbox library for Qualcomm-based phones running KaiOS
*
* Full support: KaiOS 2.5+ Nokias (Nokia 8110 4G, Nokia 2720 Flip, Nokia 800 Tough)
* Partial support: CAT B35, KaiOS 1.0 devices (Alcatel OT-4044O)
*
* Needs "certified" level in the app manifest.
* Requires additional manifest permissions:
*
* "power" - enable power management and privileged factory reset;
@plugnburn
plugnburn / frakturize.js
Created Aug 22, 2019
Frakturize: a small ES6 one-liner to generate Fraktur Unicode strings from a normal Latin
View frakturize.js
frakturize=s=>s.split('').map((c,i,h)=>/[a-zA-Z]/.test(c)?String.fromCodePoint((i=c.charCodeAt(0))>90?119997+i:((h='CHIRZ'.indexOf(c))>-1?8460+[33,0,5,16,28][h]:120003+i)):c).join('')
// Example: frakturize('ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz') => '𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ 𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷'
@plugnburn
plugnburn / unlockgen.py
Created Mar 28, 2019
Huawei modem unlock/flash code generator for algos v1/v2/v201 (Python 2 version)
View unlockgen.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import hashlib
import argparse
import binascii
import struct
def encrypt_v1(imei, key):
@plugnburn
plugnburn / paschenometer.js
Last active Jun 21, 2018
Paschenometer - visual image to text ratio meter for helpix.ru reviews
View paschenometer.js
//copy the following into browser console and run
(()=>{
let root=document.querySelector('div[itemprop="reviewBody"]'),
selCalc = sel => [].slice.call(root.querySelectorAll(sel)).reduce((v,el)=> v + (parseFloat(getComputedStyle(el).height) || 0), 0),
totalImageHeight = selCalc('div[align="center"] img'), totalTextHeight = selCalc('p'),
totalHeight = totalImageHeight + totalTextHeight;
console.log('Percentage: images - ' + (100*totalImageHeight/totalHeight).toFixed(2) + '%, text - ' + (100*totalTextHeight/totalHeight).toFixed(2) + '%')
console.log('Paschenism ratio:', (totalImageHeight/totalTextHeight).toFixed(2))
})()
@plugnburn
plugnburn / totp.red
Last active Aug 16, 2017
TOTP in Red: One-time password generation library compatible with Google Authenticator
View totp.red
Red [
Title: "TOTP library compatible with Google Authenticator"
Author: "@plugnburn"
notes {
Implements Google Authenticator-compatible TOTP algorithm.
Usage:
totp-b32 KEY ; generate a one-time password for string! key in Base32
totp-bin KEY ; generate a one-time password for binary! key
totp-genkey ; generate a random key and return it in the Base32 format
totp-genkey/pass PASSWORD ; generate a key from a password and return it in the Base32 format
@plugnburn
plugnburn / README.md
Last active Jun 29, 2019
JJY.js: Web Audio API based JJY transmitter
View README.md

JJY.js: JJY time signal emulation/transmission library

Usage

  1. Make sure that the watch/clock is configured to receive JJY 40 KHz signal (for most Casio Waveceptor/G-Shock watches, the easiest way is to enter the engineer menu by pressing Mode+Light+Receive and select J 40 reception mode, for all other watches you need to set the home city to Tokyo)
  2. Make sure your device clock is in sync before running the emulator.
  3. From the page, run:
@plugnburn
plugnburn / fibsynth.sh
Last active Jun 23, 2017
FibSynth - experimental Fibonacci based synth/sequencer based on Bash and SoX
View fibsynth.sh
#!/bin/bash
# Fibonacci Synth
# Usage: ./fibsynth.sh [a] [b] [modulo base] [scale] [interval] [tone shift]
# Example: fibsynth.sh 1 1 10 mixlyd 0.2 0
i=$1
j=$2
base=$3
interval=$5
@plugnburn
plugnburn / sociopunk.js
Created May 8, 2017
Sociopunk: text-based steganography
View sociopunk.js
// Sociopunk plaintext steganography module aimed at social network posting
// Encoding: Sociopunk.enc(secretText, coverText) when cover text is in Latin
// or Sociopunk.enc(secretText, coverText, true) when cover text is in Cyrillic
// Decoding: Sociopunk.dec(coverText) or Socipunk.dec(coverText, true) respectively
Sociopunk = (function(){
var msg2bin = m => unescape(encodeURIComponent(m)).split('').map(c=>('00000000'+c.charCodeAt(0).toString(2)).substr(-8)).join('').split('').map(Number),
bin2msg = b => decodeURIComponent(escape(b.join('').match(/\d{8}/g).map(c => String.fromCharCode(Number('0b'+c))).join(''))),
latinPattern = 'aeiocxAEIOCX', cyrPattern = 'аеіосхАЕІОСХ';
You can’t perform that action at this time.