Skip to content

Instantly share code, notes, and snippets.

View paceaux's full-sized avatar
🌐
Obsessing with languagey things

Paceaux paceaux

🌐
Obsessing with languagey things
View GitHub Profile
@paceaux
paceaux / flex-tables
Last active December 24, 2015 12:09
all the core properties stylus to make an HTML table display with the CSS flex box module
table {
display: flex;
flex-direction: column;
align-items: stretch;
}
thead {
order: -1;
}
tbody {
flex-grow: 1;
@paceaux
paceaux / paceaux-storage-pattern
Last active December 16, 2015 19:19
A very basic JavaScript object that merges localStorage and sessionStorage, and allows you to store and retrieve either objects, arrays, or text strings as your values.
store = {
types: [localStorage,sessionStorage],
convertValue: function (v) {
return typeof v !== "object" ? v : JSON.stringify(v);
},
unconvertValue: function (v) {
if (v !== null) {
if ( v.indexOf("{") === 0 || v.indexOf("[") === 0 ) {
var v = JSON.parse(v);
return v;
@paceaux
paceaux / speaker.js
Last active August 29, 2015 13:55
Speech Synthesis JS API
speech = function (msg, options, onend) {
this.text = msg;
this._defaults = {
voiceURI: 'native',
volume: 3,
rate: 2,
pitch: 1.5,
lang: 'en-US'
};
this.defaults = options !== undefined ? options : this._defaults;