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 / 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;
@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.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 / 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 / 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 / jira-dark.css
Last active May 22, 2019 18:26
Dark mode for Jira
body {
--bgColor: #111;
--textColor:rgb(201, 208, 221) ;
--infoColor: rgba(201, 208, 221, .7) ;
--titleColor: rgb(133,153,187);
--linkColor: rgb(57,114,198);
--buttonBGColor: #444547;
--buttonColor: rgb(201,228,221);
--buttonBGColorHover: #72829e;
--itemBGColor: #272524;
@paceaux
paceaux / speaker.js
Created September 3, 2019 17:16
Interface for speech synthesis in the browser
/**
* @typedef SpeakerDefaults
* @type {object}
* @property {string} voiceURI voice that the browser uses
* @property {Number} volume loudness. Between 0 and 1.0
* @property {Number} rate speed at which words are spoken. Between 0 and 2.
* @property {Number} pitch Between 0 and 2
* @property {string} lang ISO language
*/
@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 / SearchMap.js
Last active June 5, 2020 16:32
SearchMap: A JavaScript Map with searchable keys
/** Evaluates an array, makes the key lowercasee and makes the value an object with original keyname
* @param {Array} iterable=[] an array of arrays:[[key,val],[key,val]]
* @returns Array
*/
function LowercaseIterable(iterable = []) {
if (iterable.length === 0) return [];
const newIterable = iterable.map(([key, val]) => {
const entry = [
key.toLowerCase(),