Skip to content

Instantly share code, notes, and snippets.

@khornberg
khornberg / roman.numerals.js
Created August 5, 2013 19:03
Converts roman numerals to arabic numerals and arabic numerals to roman numerals. Replaces roman numerals with arabic numerals.
/**
* Converts roman numerals to arabic numerals and arabic numerals to roman numerals.
* @author Daniel Wachsstock
* @internal Modified by khornberg
* @license MIT
* @link from http://bililite.com/blog/2009/03/09/roman-numerals-in-javascript/ Daniel's orginal post
*
*/
var romanNumerals = [
[1000, 'M'],
@khornberg
khornberg / index.html
Created July 26, 2013 16:44
Encrypt form fields on the client side before submission such as a password field. Just a concept.
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
@khornberg
khornberg / gist:5971924
Created July 11, 2013 02:04
Extract bible book from well formed bible reference (e.g. John 1, 1 John 5:1-3, etc.)
public function get_bible_book( $text )
{
preg_match('/(^\w{1,3}\s)?\w+/', $text, $matches);
return $matches[0];
}