Skip to content

Instantly share code, notes, and snippets.

View ray-peters's full-sized avatar

Ray Peters ray-peters

  • San Francisco, CA
View GitHub Profile
@ray-peters
ray-peters / protected-storage.js
Last active September 18, 2015 04:43
Protected Storage
/**
* QuickStorage and ProtectedStorage
* @brief A caching control mechanism
* @author Ray Peters <[email protected]>
*/
function QuickStorage(){
this._cache = {};
}
QuickStorage.prototype.setItem = function( key, val ) {
@ray-peters
ray-peters / uberGlobalize
Last active August 29, 2015 14:07
Translates currency symbols for ONTRAPORT order forms.
(function(){
// jQuery is required to run this snippet
// They are provided above from reliable CDNs if your page doesn't already have them added.
var uberGlobalize = (function(){
var cloudFlareCDN = "//cdnjs.cloudflare.com/ajax/libs/globalize/0.1.1/cultures",
currentCulture = "",
previousCulture = "",
getCurrencySymbol = function( culture ) {
// Defaults to USD buck symbol