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 / 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)

@paceaux
paceaux / convertColorName.js
Created May 25, 2017 01:08
Convert Color Name
function convertColorName (name) {
var testEl = document.createElement('div'),
rgb;
testEl.style.backgroundColor = name;
rgb = document.body.appendChild(testEl);
rgb = window.getComputedStyle(testEl).backgroundColor;
document.body.removeChild(testEl);
return rgb;
@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)
console.clear();
/*==========
#TABLEMAKER
==========*/
/*
#TODOS
1. create add table Col <col> functionality
2. create ability to designate which <col> for which colgroup
@paceaux
paceaux / this.js
Last active March 11, 2020 20:37
const these = _itshelf = itshelf = _shelf = shelf = _itself = itself =_self = self = _me = me = _that = that = _this = this;
@paceaux
paceaux / dabblet.css
Created October 20, 2015 17:07
Font sizing demonstration
/**
* Font sizing demonstration
*/
html {
color: #333;
font-family: Helvetica, Arial;
line-height:1.618;
}
@paceaux
paceaux / dabblet.css
Last active October 16, 2015 19:49
Font sizing demonstration
/**
* Font sizing demonstration
*/
html {
color: #333;
font-family: Helvetica, Arial;
line-height:1.618;
}
@paceaux
paceaux / tridionWindow.js
Created August 13, 2015 20:28
Get the Window that contains Tridion and Anguilla
var TridionWindow = function () {
if ($messages) {return window;} else {
for (var i = 0; i<frames.length; i++) {
if (frames[i].$messages) return frames[i];
}
}
}
tridionWindow = tridionWindow();
@paceaux
paceaux / canvasApp.js
Last active August 29, 2015 14:21
Canvas app. Simple api for creating and drawing on canvas.
var CvsApp = function (selector) {
this.el = document.querySelector(selector);
this.ctx = this.el.getContext('2d');
this.shapes = [];
this.Shape = function (x,y) {
this.path = new Path2D();
this.coords = { x:x, y:y};
this.size = {h:'', w:''};
};
this.addShape = function (shape) {
@paceaux
paceaux / demo.html
Last active September 15, 2015 07:56
Brightness Detection
<section>
<figure class="static">
<img src="img/img1.jpg" data-imgDetect="parentClass" class="static__img"/>
</figure>
<figure class="static">
<img src="img/img2.jpg" data-imgDetect="selfClass" class="static__img"/>
</figure>
<figure class="static">
<img src="img/img3.jpg" data-imgDetect="parentClass" class="static__img"/>
</figure>