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 / queryCSSProperty
Last active October 19, 2020 17:16
Get all CSS selectors containing a particular CSS property
/** queryCSSByPropertyName
* queries the CSSOM looking for CSS rulesets containing a particular CSS property.
* @param {string} queryPropName CSS property name
* @param {string} queryPropValue value of CSS property
* @returns Map with key as CSS selector, value as CSS properties.
*/
function queryCSSByProperty(queryPropName, queryPropValue) {
const styleSheets= document.styleSheets; // get all the stylesheets
const properties = new Map(); // set up the variable that'll store our result
@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 / graphicEQUrl.js
Last active June 28, 2020 15:38
Graphic EQ in a url
/* Courtesy of Jake Albaugh: https://twitter.com/jake_albaugh/status/1118611365508337665 */
const bars = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"];
const ctx = new AudioContext();
const analyser = ctx.createAnalyser();
analyser.fftSize = 32;
const uIntArray = new Uint8Array(16);
navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {
ctx.createMediaStreamSource(stream).connect(analyser);
updateUrl();
@paceaux
paceaux / collatz.js
Last active March 29, 2019 17:47
Math Buddies
function collatz(n, steps = []) {
if (isNaN(n)) return NaN;
if (steps.length === 0) steps.push(n);
const isEven = n%2 === 0;
const newInt = isEven ? n / 2 : (3 * n) + 1;
steps.push(newInt);
return newInt !== 1 ? collatz(newInt, steps) : steps;
@paceaux
paceaux / rtfToJson.py
Last active February 8, 2019 21:12
RTF to JSON parser
import os, shutil, sys, getopt, fnmatch, json
from os.path import join
from HTMLParser import HTMLParser
from pyth.plugins.rtf15.reader import Rtf15Reader
from pyth.plugins.xhtml.writer import XHTMLWriter
from bs4 import BeautifulSoup
# constants
DEFAULT_DICTIONARY = {
'chronoNumber': '',
@paceaux
paceaux / conjugation.go.js
Last active November 16, 2018 15:49
Verb Conjugations
const verbAspects = ['simple', 'continuous', 'perfect', 'perfectContinuous'];
const verbTenses = ['past', 'present', 'future'];
const verbMoods = ['indicative', 'imperative', 'subjunctive'];
const moods = {
indicative: {
present: {
@paceaux
paceaux / conjunctions.english.js
Created October 5, 2018 21:49
English conjunctions
/*
* Conjunctions
* https://www.english-grammar-revolution.com/list-of-conjunctions.html
*/
module.exports = [
{
conjunction: ['and'],
type: 'coordinating',
},
@paceaux
paceaux / adjectives.descriptive.english.js
Last active October 5, 2018 22:18
English Adjectives
/*
* List of Descriptive Adjectives
* https://www.ef.edu/english-resources/english-vocabulary/top-50-adjectives/
*/
module.exports = [
'able',
'bad',
'best',
'better',
@paceaux
paceaux / prepositions.english.js
Created September 17, 2018 13:39
English Prepositions for JavaScript
/*
* English preposition list
* https://www.talkenglish.com/vocabulary/top-50-prepositions.aspx
*/
module.exports = [
'of',
'with',
'at',
'from',