Skip to content

Instantly share code, notes, and snippets.

@plugnburn
plugnburn / b312e-cheatbook.md
Last active April 3, 2023 17:34
Samsung B312E Cheatbook

B312E Cheatbook: pump up your Samsung Metro!

This is probably the most complete cheats and secret codes reference for the new Samsung SM-B312E phone you can ever find on the Internet. The main reason I say this is because most of the codes were dumped straight from the firmware (the European version, B312EXXNE6), others, meant for much older models, were also found on the Internet, but almost all of them were then tested on a real device (if the code is not tested, there's a note about this in the "Notes and warnings" column) and a description was made what do they do right here, on B312E. This cheatbook is divided into several parts: information codes, testing codes, setting codes, codes with undefined behavior and general tips and tricks.

Please note: GSM-related USSD codes (such as call divert, Caller ID display etc) are not included here because all of them are common for all GSM phones, their functionality is completely duplicated in standard call settin

@plugnburn
plugnburn / chromium-flags.conf
Last active February 8, 2023 18:37
How to enable dark mode preference for the web page CSS queries in Ungoogled Chromium (put this into your ~/.config/chromium-flags.conf)
--force-dark-mode
--enable-features=WebUIDarkMode
@plugnburn
plugnburn / README.md
Last active February 7, 2023 17:12
Landmark - a minimalistic and extensible Markdown compiler in JavaScript

Landmark: the simplest Markdown engine for the browser

Landmark is a small but extensible JavaScript library that allows to render Markdown documents into HTML. It's the primary engine for Sitemark and some other projects.

Usage

Landmark features only 2 methods:

@plugnburn
plugnburn / README.md
Last active January 31, 2023 15:02
DaBi - live two-way DOM-to-data binding in 25 lines of JS

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 / picoluhn.js
Last active January 10, 2023 19:18
An attempt to get a Luhn implementation as small as possible
// Input: a string of digits (w/o the check digit)
// Output: the check digit
// Universal algo - smallest option so far (67 chars after the assignment):
luhn=s=>(10-[...s].reverse().reduce((a,v,i)=>a+v*(i&1?1:2.2)|0,0)%10)%10
// IMEI version (14-digit or any other even-digit input) - smallest option so far (57 chars after the assignment):
luhnImei=s=>(10-[...s].reduce((a,v,i)=>a+v*(i&1?2.2:1)|0,0)%10)%10
// Credit card version (15-digit or any other odd-digit input) - smallest option so far (57 chars after the assignment):
@plugnburn
plugnburn / telememer.js
Created January 5, 2023 20:24
Telememer: a JS library to encode/decode information to/from Casio module 2747/5574 Telememo 30 format
// Telememer: a JS library to encode/decode information to/from Casio module 2747/5574 Telememo 30 format
// Supports up to 378 bytes of raw binary data
// Requires BigInt support in the browser's or other JS engine
// Created by Luxferre in 2023, released into public domain
// Made in Ukraine
Telememer = (params => {
var nameAlphabet = params[0],
digitAlphabet = params[1],
indexAlphabet = params[2],
@plugnburn
plugnburn / README.md
Last active September 8, 2022 18:43
Micromark engine

Micromark: probably the smallest JS framework to create your own text markup languages

Overview

Have you ever dreamed of creating your own simple text markup language without all the overhead of existing parsers? Now it is possible thanks to this tiny function. Define your own rules for substituting your own character tags with HTML markup and pass them to Micromark along with your text, and it will return ready HTML code.

How to use the engine

Call the function like this:

@plugnburn
plugnburn / LICENSE.txt
Last active June 20, 2022 21:38 — forked from 140bytes/LICENSE.txt
Text ZALGifier
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 plugnburn
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@plugnburn
plugnburn / usbio.js
Last active February 1, 2022 11:10
USBIO.js: a convenient wrapper class for WebUSB interaction (for further mobile toolkits)
//USB I/O class for WebUSB
//(c) Luxferre 2020-present
class USBIO {
//Possible devFilter fields: classCode, subclassCode, protocolCode, vendorId, productId, serialNumber (not recommended)
constructor(devFilter = {}) {
this.requestDeviceObject = {filters:(devFilter ? [devFilter] : [])}
this.devFilter = devFilter
@plugnburn
plugnburn / LICENSE.txt
Last active January 8, 2022 19:40 — forked from 140bytes/LICENSE.txt
Linear Feedback Shift Register implementation
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 plugnburn
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE