Skip to content

Instantly share code, notes, and snippets.

@plugnburn
plugnburn / README.md
Last active August 19, 2023 14:01
Samples.js: a tiny and simple Web Audio API based sample playback library

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 / stego-bookmarklet
Last active August 29, 2015 14:17
tweetStego
javascript:(function(s){s=document.createElement('script');document.body.appendChild(s);s.onload=function(){TSWidget()};s.src='https://cdn.rawgit.com/plugnburn/bc773a2f912acba406ef/raw/tweetStego.js'})(),void 0
@plugnburn
plugnburn / mobile-meta.html
Last active April 16, 2016 01:54
A reference set of mobile meta tags for quick pasting
<!-- general features -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no"> <!-- iOS & Android -->
<meta name="format-detection" content="address=no"> <!-- iOS & Android -->
<!-- iOS only features -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Short name">
<meta name="apple-mobile-web-app-status-bar-style" content="default"> <!-- possible values: default, black, black-translucent -->
<!-- Android only features -->
<meta name="viewport" content="target-densitydpi=device-dpi"> <!-- Android only before 4.4, possible values: device-dpi, high-dpi, medium-dpi, low-dpi -->
@plugnburn
plugnburn / barbust.js
Created March 26, 2015 12:14
BarBust - a JS hack to hide mobile browser's address bar on load or handheld rotation
if('addEventListener'in self && 'pageYOffset'in self && !location.hash.substr(1)) {
(function(c){
self.addEventListener('DOMContentLoaded',c,!1);
self.addEventListener('orientationchange',c,!1)
})(function(){
setTimeout(function(P){
P=self.pageYOffset;
self.scrollTo(0,1);
if(self.pageYOffset) self.scrollTo(0,0);
if(P>20) self.scrollTo(0,P)
@plugnburn
plugnburn / neogrid.css
Last active August 29, 2015 14:17
neoGrid
.row{width:100%;display:table;table-layout:fixed;border-collapse:collapse;margin:0;padding:0}
.row.auto{table-layout:auto}
.col,.col1,.col2,.col3,.col4,.col5,.col6,.col7,.col8,.col9,.col10,.col11,.col12{display:table-cell;border:hidden;vertical-align:top;margin:0;padding:0}
.vpos-middle{vertical-align:middle}
.vpos-bottom{vertical-align:bottom}
.col1{width:8.333333%;width:-webkit-calc(100%/12);width:-moz-calc(100%/12);width:calc(100%/12)}
.col2{width:16.666666%;width:-webkit-calc(100%/6);width:-moz-calc(100%/6);width:calc(100%/6)}
.col3{width:25%}
.col4{width:33.333333%;width:-webkit-calc(100%/3);width:-moz-calc(100%/3);width:calc(100%/3)}
.col5{width:41.666666%;width:-webkit-calc(500%/12);width:-moz-calc(500%/12);width:calc(500%/12)}
@plugnburn
plugnburn / tweetgrid.css
Last active August 29, 2015 14:17
TweetGrid: a tweet-sized (137 bytes) fork of ungrid.css with pixel media limit, shorter class names and two helper classes for one-third and one-fourth layout cases
@media(min-width:481px){.gr{width:100%;display:table;table-layout:fixed}.gc{display:table-cell}.gc.f3{width:33.333333%}.gc.f4{width:25%}}
@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 / anonstrap.sh
Created November 2, 2014 15:40
AnonStrap - experimental anonymous posting engine using DualWarp-type loader, StrapdownJS renderer and TinyURL API
#!/bin/bash
#Usage: anonstrap.sh [your markdown file] ["optional title"]
LOADER="http://bl.ocks.org/anonymous/raw/f15ba2c3e3ea8742ced3/"
INMD="$1"
TITLE="$2"
[ -z "$TITLE" ] && TITLE="Anonymous post"
INPUT="$(<$INMD)"
HTML="<!DOCTYPE html><html><head><meta charset=utf-8><title>${TITLE}</title></head><xmp style='display:none'>${INPUT}"'</xmp><script src="http://strapdownjs.com/v/0.2/strapdown.js"></script></html>'
B64=$(echo -n "$HTML"|base64 -w 0)
DATAURL="data:text/html;charset=utf-8;base64,$B64"
@plugnburn
plugnburn / README.md
Last active August 29, 2015 14:06
SMSPP: Short Message Security

SMSPP: Short Message Security

Overview

SMSPP (stands for Short Message Security - Pencil and Paper) is a simple, pencil-and-paper based protocol to exchange very short encrypted messages via commonly available communication channels with a limited character set (such as SMS, hence the name).

SMSPP Workflow

@plugnburn
plugnburn / watchcoder.sh
Last active August 29, 2015 14:05
WatchCoder - encode any number from 0 to 5183999 to the values you can store in your Casio electronic watch, decode the stored values back into number
#!/bin/bash
# The WatchCoder method guarantees to encode an unsigned 22-bit (or signed 21-bit converted to unsigned)
# integer into the values present in any electronic Casio watch: an alarm setting and 1-hour stopwatch
# Maximal theoretically encodable unsigned value is 5183999
case "$1" in
num2watch)
[ -z "$2" ] && echo "Specify the number to encode" && exit 1
NUM=$2
SWDABS=$(($NUM / 1440))
ALMABS=$(($NUM % 1440))