Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / README.md
Last active May 26, 2024 11:20
Statix - the simplest static website generator in bash

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 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 / diffie.sh
Last active November 17, 2023 21:10
Sample Diffie-Hellman key exchange helper implementation in Bash (depends on dc for bigint and od for secret generation)
#!/bin/bash
# RFC 3526 prime and base (id 14, 2048-bit)
PRIME='FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F4
4C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED52907709
6966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFF
FFFFFFFFFFFF'
BASE=2
@plugnburn
plugnburn / README.md
Last active May 23, 2024 07:59
NokiaTool - simple interface Bash script for MediaTek-based Nokia simple phones

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 / index.html
Created February 23, 2016 05:48
Malevich
<div style="background:black;width:90vmin;height:90vmin;position:fixed;left:50%;top:50%;transform:translate(-50%,-50%)"></div>