Skip to content

Instantly share code, notes, and snippets.

@LoneFry
LoneFry / enabledOnClick.js
Last active December 16, 2015 19:09
Adjusts a form to only send changed inputs by disabling inputs indicated (with class "js-enabledOnClick") and adding a click handler to re-enable them. Useful for large forms in which few edits are expected.
/**
* enabledOnClick
*
* Disabled specified form inputs until they are clicked.
* This reduces overhead in HTTP by transmitting less data
* Server Scripts by parsing fewer fields
* SQL by sending fewer record UPDATEs
*
* To specify an input for inclusion add class="js-enabledOnClick"
*/
@LoneFry
LoneFry / base_convert_.php
Created September 27, 2012 03:31
Convert numbers up to base73
<?php
/**
* Convert a number from one base to another
* Modelled after PHP's base_convert(), but able to handle base73
*
* @param string $num The number to convert
* @param int $from The base from which to convert
* @param int $to The base to which to convert
*
* @return string The converted number
@LoneFry
LoneFry / .vimrc
Created October 14, 2011 07:03
My budding .vimrc
" Show line numbers
set number
" Use hard tabs, render as four spaces
set noexpandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set autoindent