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 / sorter.py
Last active October 4, 2023 15:39
Camera Phone Image Sorter
# Description:
# Sorts files created with a date and time in the file name, puts them in their respective folders
# This was created to sort images taken with a Samsung Galaxy phone
# Expected file naming convention is
# "year-month-day hour.minute.second.fileextension"
# "2017-7-5 18.23.45.jpg"
#
#
# requires Pillow:
# pip install Pillow
@paceaux
paceaux / headless-screenshots_v2.js
Last active February 20, 2024 02:54
Improved command line options for headless screenshots in Chrome
/** Pre requisites
* MAC ONLY FOR RIGHT NOW! Not my fault. We have to wait for Headless Chrome to hit Windows users
1) Make an Alias to Chrome
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
alias chrome-canary="/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary"
2) Make Sure yarn is installed (it caches packages so you don't have to download them again)
`npm i yarn`
3) Use yarn to install dependencies:
@paceaux
paceaux / attribute-promise.js
Created June 16, 2017 21:11
A promise that can be set on an element, to resolve when that element's attributes have changed
** AttrPromise
* @param {element} DOM element. required
* @param {attributeName} String. Optional. Attribute that is expected to change.
* @param {rejectTime} Int. Optional. Seconds (not ms) to wait before rejecting. 0 means there is no reject time.
* @returns {promise}
*/
function attrPromise(element, attributeName,rejectTime = 0) {
return new Promise((resolve,reject) => {
let hasChanged = false;
@paceaux
paceaux / headless-screenshots.js
Last active May 13, 2024 06:34
Screenshot grabber that uses headless chrome (only works on mac)
/** Pre requisites
1) Make an Alias to Chrome
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
alias chrome-canary="/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary"
2) Make Sure yarn is installed (it caches packages so you don't have to download them again)
`npm i yarn`
3) Use yarn to install dependencies:
`yarn add lighthouse`
@paceaux
paceaux / tinyRules.css.md
Last active April 10, 2025 21:59
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;
}