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 / CSSOM
Last active August 22, 2018 01:06
CSSOM debugger See the stylesheets and the rules in the stylesheets.
window.analyzer = {
init: function (object, id) {
this.functions.appendTable(id);
this.functions.setupHeaders(object);
this.functions.addData(object);
this.functions.addCaption("Analysis of the stylesheets");
},
data: {},
helpers: {
wrapper: function (id) {
@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;