Skip to content

Instantly share code, notes, and snippets.

View terrillo's full-sized avatar

Terrillo Walls terrillo

View GitHub Profile
@klederson
klederson / HTML5StorageMultidimensional.js
Created October 8, 2012 18:23
Adding Multidimensional Support for javascript / html5 sessionStorage , localStorage or just Storage object
/**
*
* MOVED TO: https://github.com/iFind/html5MultidimensionalStorage
*
* This methods extends the default HTML5 Storage object and add support
* to set and get multidimensional data
*
* @example Storage.setObj('users.albums.sexPistols',"blah");
* @example Storage.setObj('users.albums.sexPistols',{ sid : "My Way", nancy : "Bitch" });
* @example Storage.setObj('users.albums.sexPistols.sid',"Other songs");
@rbk
rbk / common.js
Last active August 29, 2015 14:07
Pre load images
// Page this function a javascript array of image urls to preload them!
function pre_load_images(images){
for( var i=0; i < images.length; i++ ){
var img_new = document.createElement('img');
img_new.setAttribute( 'src', images[i] );
img_new.setAttribute( 'style', 'display:none;' );
document.body.appendChild(img_new)
}
}
@anaptfox
anaptfox / amazon-polly-file.js
Created December 13, 2016 13:54
Node.js Amazon Polly to file example.
// Load the SDK
const AWS = require('aws-sdk')
const Fs = require('fs')
// Create an Polly client
const Polly = new AWS.Polly({
signatureVersion: 'v4',
region: 'us-east-1'
})
@nicolasdao
nicolasdao / webpack.md
Last active June 22, 2024 02:56
Basic damn Webpack config for simple transpilation ES6 to ES5

Install

npm install -D acorn babel-loader @babel/core @babel/preset-env babel-polyfill webpack webpack-cli uglifyjs-webpack-plugin --save-dev

webpack-cli and acorn are dependencies that you, unfortunately, have to install if you want to run this god damn thing without any obscure warnings or errors.

Build

Configure Webpack