Skip to content

Instantly share code, notes, and snippets.

@plugnburn
plugnburn / README.md
Last active Jan 14, 2021
Zen.js - reactive nano-framework in 50 lines of JS
View README.md

Zen.js

It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to take away.

Antoine de Saint Exupéry

Zen.js is tiny attempt to create the Zen of reactive in-memory storage on the JS client-side environment.

How to obtain

@plugnburn
plugnburn / README.md
Last active Jan 9, 2021
Statix - the simplest static website generator in bash
View README.md

Statix - the simplest static website generator in Bash

Statix is a stand-alone Bash script aimed at generating full-featured, routable static websites from reusable HTML snippets. It features the most basic templating engine ever possible but allows to organize your content in a SEO-friendly way. All Statix-based websites contain these parts:

  • Templates: a directory where all HTML templates are stored
  • Route configuration: a file that maps each publicly accessible template to a SEO-friendly URL
  • Assets: a directory with optional files copied to the output website directory with no processing.

This script is also lightweight. Aside from some standard file management commands such as cp, mkdir and rm, the only serious dependency for Statix is GNU Grep compiled with PCRE support (i.e. the version that supports -P flag, included in most Linux distributions).

@plugnburn
plugnburn / README.md
Last active Dec 21, 2020
DaBi - live two-way DOM-to-data binding in 25 lines of JS
View README.md

DaBi: data binding library that keeps it simple

DaBi (short for Data Binding) is a dead simple yet complete and self-contained DOM-to-JS and JS-to-DOM data binding library in just 25 lines of pure ES5 and 454 bytes when minified.

How to obtain

Download it right here or include it into your HTML:

@plugnburn
plugnburn / README.md
Last active Dec 19, 2020
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 / README.md
Last active Nov 1, 2020
Samples.js: a tiny and simple Web Audio API based sample playback library
View README.md

Samples.js: a tiny and simple Web Audio API based sample playback library

Web Audio API spec is a great way of professional audio playing and mixing in the modern browser. However, it's too complex and versatile for some simple one-off tasks such as "load an audio sample into memory and just play it when necessary". That's why Samples.js has come true. It's a really simple and tiny (less than 1K minified) library that exposes just 5 methods to manipulate your samples from JS code in a really easy and fun way.

API reference

The library exposes the following calls:

@plugnburn
plugnburn / README.md
Last active Oct 30, 2020
NokiaTool - simple interface Bash script for MediaTek-based Nokia simple phones
View README.md

NokiaTool: control MediaTek-based Nokia phones from your PC

Overview

NokiaTool is a simple Bash script (nokiatool.sh) that allows you to use an undocumented serial connection in USB-enabled MediaTek-based Nokia feature phones manufactured by Microsoft (even the most basic ones, like the new 105) in order to control them from your PC.

This project is an ongoing work and uses only some bits and pieces of information about the phone internals available to the public, so under any circumstances don't consider it stable or a replacement for official tools if any are present.

@plugnburn
plugnburn / olc.js
Last active Oct 27, 2020
TinyOLC - smallest Open Location Code implementation in JS
View olc.js
/**
* TinyOLC - Open Location Code for smallest applications
* Differences from Google's open-source JS implementation:
* - less than 600 bytes minified (as opposed to over 4.5 KB from Google)
* - only 2 methods exposed - encode (lat, lng => str) and decode (str => [lat, lng])
* - only floating point degrees accepted as encoding input (positive as N and E, negative as S and W)
* - no short code resolution
* - no area encoding, only points with 11-digit resolution
* - assuming the block lower left corner only when decoding a low-res code
* - no validation checks
@plugnburn
plugnburn / mtk-bootseq.py
Created Jun 15, 2020
MTK Bootseq: enter alternative boot modes in MediaTek-based smartphones
View mtk-bootseq.py
#!/usr/bin/env python3
# Simple script to enter the necessary boot mode in the MT6572-based (etc) phones
# Depends on pyserial, otherwise fully cross-platform
# Usage: python3 mtk-bootseq.py [MODECMD] [port]
# e.g. python3 mtk-bootseq.py FASTBOOT /dev/tty.usbmodem14200
# and then connect the cable and repeatedly short-press the power on key
# Supported commands depend on the device and its preloader. Here's the list for Sigma S3500 sKai:
@plugnburn
plugnburn / libwallace.js
Last active Sep 25, 2020
LibWallace: toolbox library for Qualcomm-based phones running KaiOS
View libwallace.js
/**
* LibWallace: toolbox library for Qualcomm-based and MTK-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), MTK devices (Sigma S3500 sKai)
*
* Needs "certified" level in the app manifest.
* Requires additional manifest permissions:
*
* "power" - enable power management and privileged factory reset;
@plugnburn
plugnburn / .nanorc
Last active Sep 16, 2020
Plugnburn's .nanorc
View .nanorc
include /usr/share/nano/sh.nanorc
include /usr/share/nano/ruby.nanorc
include /usr/share/nano/python.nanorc
include /usr/share/nano/php.nanorc
include /usr/share/nano/json.nanorc
include /usr/share/nano/xml.nanorc
include /usr/share/nano/nanorc.nanorc
include /usr/share/nano/css.nanorc
include /usr/share/nano/html.nanorc
include /usr/share/nano/js.nanorc
You can’t perform that action at this time.