Skip to content

Instantly share code, notes, and snippets.

@openjck
openjck / eslint-health.js
Last active August 7, 2020 05:37
Node script which fails with an error message if this project has too many ESLint problems. Use this gradually reduce the number of problems to zero. https://medium.com/reflections-on-building-software/gradually-reduce-the-number-of-eslint-problems-in-your-codebase-fe503d4f2716
#!/usr/bin/env node
/**
* Fail with an error message if this project has too many ESLint problems.
*
* Configuration options:
*
* config.maxProblems: The maximum number of problems that should be allowed.
* If the number of problems exceeds this value, the
* script will fail with an error message. Consider
@openjck
openjck / LICENSE
Last active October 22, 2023 23:38
This license applies to all of my public Gists
Copyright 2013-2023 John Karahalis
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@openjck
openjck / eslint-health
Last active July 27, 2020 19:22
Bash script which exits with an error if there are too many ESLint problems. Use this gradually reduce the number of problems to zero. https://medium.com/reflections-on-building-software/gradually-reduce-the-number-of-eslint-problems-in-your-codebase-fe503d4f2716
#!/usr/bin/env bash
# Fail if there are too many ESLint problems. The definition of "too many" is
# hardcoded. The number can be manually lowered over time as problems are fixed
# to prevent regressions.
#
# This is a copy of the following Gist:
# https://gist.github.com/openjck/ab1a435e249580861afbc5b93465e611
#
# More information:
@openjck
openjck / keybase.md
Created December 5, 2019 05:47
keybase.md

Keybase proof

I hereby claim:

  • I am openjck on github.
  • I am johnkarahalis (https://keybase.io/johnkarahalis) on keybase.
  • I have a public key whose fingerprint is F941 FEA9 729E 1040 6829 CE96 357D 0C1B 6454 146A

To claim this, I am signing this object:

@openjck
openjck / metrics-graphics-#783.html
Last active December 22, 2017 00:05
HTML document demonstrating the issue described in metricsgraphics/metrics-graphics#783
<!doctype html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8" />
<title>Example</title>
<link href="https://rawgit.com/mozilla/metrics-graphics/b363d82c229fba6a280c9782b8154aad0ac901e7/dist/metricsgraphics.css" rel="stylesheet" />
</head>
<body>
<div id="target"></div>
@openjck
openjck / metrics-graphics-#764.html
Last active August 8, 2017 21:29
HTML document demonstrating the issue described in metricsgraphics/metrics-graphics#764
<!doctype html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8" />
<title>Example</title>
<link href="https://rawgit.com/mozilla/metrics-graphics/4722d8a7aaaea604a942f6b39bd169b9bfa815fb/dist/metricsgraphics.css" rel="stylesheet" />
</head>
<body>
<div id="target"></div>
@openjck
openjck / bookmarklet-remove-wikipedia-pictures.js
Last active March 8, 2016 01:04
Simple bookmarket to remove pictures in Wikipedia articles
javascript:(function(){$('#mw-content-text .thumb, #mw-content-text img').remove();})();
@openjck
openjck / bookmarklet-remove-wikipedia-links.js
Last active March 7, 2016 22:39
Simple bookmarket to remove distracting links in Wikipedia articles
{# Randomly determine if the new heading should be shown #}
{% set show_new_heading = random_boolean() %}
{% if show_new_heading %}
<h1>The Best Documentation Around</h1>
{% endif %}
<script>
window['optimizely'] = window['optimizely'] || [];
@openjck
openjck / fix-static-drupal-site-filenames.sh
Last active January 18, 2016 01:21
Script that restores original filenames (misc/drupal/index.js -> misc/drupal.js) after following the steps in this article: http://webikon.com/cases/park-your-old-drupal-site
#!/bin/bash
# Fix filenames after making a static copy of a Drupal website. This script
# should only be run after following all of the steps in this article:
#
# http://webikon.com/cases/park-your-old-drupal-site
#
# When the steps in the article are followed, all files are renamed to
# index.[ext], so you end up with a bunch of files like misc/drupal.js.
# This script restores the original filenames (e.g., misc/drupal.js), and