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 / 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 / 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 / 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 / cssom.js
Last active December 26, 2015 13:29
Stylesheet toggler. Uses the CSSOM (Cascading StyleSheet Object Model). Drop this somewhere on your page and it'll find your stylesheets and let you turn them on and off.
window.cssom = {
init: function () {
var _this = window.cssom;
_this.functions.bootstrapTable();
},
data: {
table: {},
rootClass: "CSSOM",
tableClass: "table",
rowButton: {
@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;
@jhorsman
jhorsman / SDL Tridion versions
Last active May 29, 2020 08:47
SDL Tridion versions and release dates
Release 1 (1996)
Release 2 (1997)
Release 3 (1999)
Release 4 (2001)
Release 5 (2003)
Tridion 5.1 (2005)
Tridion 5.2 (2006)
SDL Tridion 5.3 (January 2008)
SDL Tridion 2009 (November 2009)
SDL Tridion 2011 (Januari 2011)
@paceaux
paceaux / cleaner.py
Created April 18, 2017 22:20
Cleaner: get rid of old files in a directory
# Shamelessly stolen from https://www.quora.com/As-a-programmer-what-tasks-have-you-automated-to-make-your-everyday-life-easier/answer/Cory-Engdahl?srid=tVE5
#
# Usage:
# python cleaner.py -f [full/path/to/folder]
# arguments
# -p, --path : fully qualified path to folder (required)
# -d, --days : Age in days of the file to delete (optional, default is 1 day)
# -e, --exclude: name of files to save (optional)
# -i, --include: name of files to delete regardless of timeframe (optional)
@paceaux
paceaux / tinyRules.css.md
Last active April 3, 2024 01:19
Tiny rules for how to name things in CSS and JS

Tiny rules for how to name stuff

CSS

How to name CSS classes

Stateful Class names

Is it a state that is only one of two conditions? (i.e. a boolean)

Scss Style Guide Starter

Special thanks to Carwin Young (Github @carwin) whose docs this is based on

This is a guide for formatting Sass stylesheets, it's goals are:

  • To encourage consistency between developers in a repository.
  • Styles applying to an element should be in one place
  • Code should be easily find-able and legible by humans
  • Classes are mostly explicitly named (pointing to specific elements, not functionality)