Skip to content

Instantly share code, notes, and snippets.

View jareha's full-sized avatar

Jonathan Horak jareha

  • Publicis Sapient
  • Chicago, IL
  • X @jareha
View GitHub Profile
@jareha
jareha / tweetbot_mute-major-league-baseball.txt
Last active January 24, 2022 21:41 — forked from LK64076007A/gist:077d5b4b503a6d7891de
Regex mute filter for all Major League Baseball teams in Tweetbot, excepting “Texas Rangers” to avoid false positives
tweetbot:///mute/keyword?regex=1&text=Anaheim Angels%7CArizona Diamondbacks%7CAtlanta Braves%7CBaltimore Orioles%7CBoston Red Sox%7CChicago Cubs%7CChicago White Sox%7CCincinnati Reds%7CCleveland Guardians%7CCleveland Indians%7CColorado Rockies%7CDetroit Tigers%7CHouston Astros%7CKansas City Royals%7CLos Angeles Angels%7CLos Angeles Dodgers%7CMiami Marlins%7CMilwaukee Brewers%7CMinnesota Twins%7CNew York Mets%7CNew York Yankees%7COakland Athletics%7CPhiladelphia Phillies%7CPittsburgh Pirates%7CSan Diego Padres%7CSan Francisco Giants%7CSeattle Mariners%7CSt. Louis Cardinals%7CTampa Bay Rays%7CToronto Blue Jays%7CWashington Nationals
@jareha
jareha / .eslintrc.js
Last active January 24, 2022 21:22
Airbnb JavaScript Style Guide+
/* jshint esversion: 8 */
/* globals module */
module.exports = {
env: {
browser: true,
node: true,
},
extends: "airbnb",
parser: "@babel/eslint-parser",
parserOptions: {
@jareha
jareha / keyword-search.js
Last active April 30, 2024 16:36
Keyword search (bookmarklet) template with implementations
/* jshint esversion: 8 */
(function () {
const fallback = null;
const keyword = "%s";
const service = "https://www.example.com/";
const suffix = "";
if (keyword !== "" || keyword !== "%" + "s") {
window.location = `${service}?q=${keyword}${suffix}`;
} else {
@jareha
jareha / cookie-setter.js
Last active January 24, 2022 21:28
Cookie setter with defaults
@jareha
jareha / bookmarklet_localhost-toggler.js
Last active September 19, 2022 03:18
Bookmarklet to toggle between `localhost` and production
/* jshint esversion: 8 */
(function () {
const domain = "https://example.com";
const isLocalhost = window.location.href.indexOf("localhost") >= 0;
const localhost = "http://localhost:8080";
const pathname = window.location.pathname;
const url = isLocalhost ? (domain + pathname) : (localhost + pathname);
window.location = url;
})();
@jareha
jareha / bookmarklet_passivator.js
Created January 26, 2022 21:36
Bookmarklet to highlight adverbs and passive verbs
/* jshint esversion: 8 */
(function () {
// List of verbs, for editing convenience
// am
// are
// be
// been
// being
// go
// hasn't
@jareha
jareha / ds_store.sh
Last active February 8, 2022 16:38 — forked from vybstat/ds_store_removal
Remove `.ds_store` files created by macOS from local `git` repo
# Find and remove `.ds_store` files from local `git` repo
find . -name .ds_store -print0 | xargs -0 git rm -f --ignore-unmatch
@jareha
jareha / bookmarklet_scrollbar-scofflaws.js
Created February 8, 2022 19:51
Bookmarklet to highlight DOM elements that cause horizontal scrollbars
/* jshint esversion: 8 */
(function (currentDocument) {
const treeWalker = currentDocument.createTreeWalker(currentDocument.body, NodeFilter.SHOW_ELEMENT);
const width = currentDocument.documentElement.offsetWidth;
while (treeWalker.nextNode()) {
const domRectangle = treeWalker.currentNode.getBoundingClientRect();
if (domRectangle.right > width || domRectangle.left < 0) {
const currentNode = treeWalker.currentNode;
@jareha
jareha / bookmarklet_chicago-public-library_merlo-film-calendar.js
Created April 10, 2023 19:08
Bookmarklet to show film calendar for Merlo Branch of Chicago Public Library
/* jshint esversion: 8 */
(function () {
// Sweden (`sv`) outputs something close to ISO
const currentDate = new Date().toLocaleDateString("sv", {
timeZone: "America/Chicago",
});
const parameters =
"?locations=51&programs=5c9261756fdc8d742d2296a5" +
"&startDate" +
currentDate.split("T")[0].replace("T", "");