Skip to content

Instantly share code, notes, and snippets.

View stedman's full-sized avatar

Steve Stedman stedman

View GitHub Profile
@stedman
stedman / .editorconfig
Last active March 16, 2021 22:43
Set up common Node projects with npm, ESLint (Airbnb config), Prettier, EditorConfig, and .gitignore. Note that all files are saved in user directory (`~/`).
# https://editorconfig.org
root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
@stedman
stedman / npm-systems-testing-2021.md
Last active January 6, 2021 21:10
Systems (e2e) Testing in 2021

Systems (e2e) Testing

This is an evaluation of the choices available for systems, or end-to-end (e2e), testing in 2021.

Requirements

  • JavaScript npm package - consistent with frontend tools
  • runs on local dev environment
  • runs on build system (Jenkins)
  • uses major browser engines: Blink, Gecko, Webkit
@stedman
stedman / .markdownlint.jsonc
Created November 28, 2020 23:28
MarkdownLint default config file
{
"default": true, // Default state for all rules
"MD001": true, // heading-increment/header-increment - Heading levels should only increment by one level at a time
"MD002": {
"level": 1
}, // first-heading-h1/first-header-h1 - DEPRECATED - First heading should be a top level heading
"MD003": {
"style": "consistent"
}, // heading-style/header-style - Heading style
"MD004": {
@stedman
stedman / break-softly.js
Last active December 3, 2019 21:54
Insert optional HTML content break points to improve word wrap appearance.
/**
* HTML content doesn't always break where we want it to--especially when long,
* unbroken strings are present. If we want HTML to optionally break at certain
* pre-determined points, we add <wbr> (word break oppportunity) tags.
*
* This utility adds <wbr> tags after a specified content length and character.
*
* For example, given the following string:
* https://github.com/stedman/long-hash/raw/file-name.js
* ...if we want to gracefully break after 30 characters and a forward slash (/),
@stedman
stedman / load-browsers.py
Last active March 9, 2021 00:18
Load local development URL in multiple browsers simultaneously.
#!/usr/bin/python
##
## Load local development URL in multiple browsers simultaneously.
##
import subprocess
browsers = {
'brave': {
@stedman
stedman / docker-compose.yml
Created November 15, 2019 01:44
Docker setup for WordPress + MySQL
version: '3'
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress
MYSQL_USER: user
@stedman
stedman / ReadHub bookmarklet URL
Created October 23, 2019 18:24
Bookmarklet to make GitHub READMEs a bit more readable (ala Medium.com).
javascript:(function()%7Bconst%20d%3Ddocument%2Cb%3Dd.body%3Bif(b.classList.contains('RH'))return%3Bd.head.insertAdjacentHTML('beforeend'%2C%60%3Cstyle%3E.RH%20.js-header-wrapper%2C.RH%20.footer%2C.RH%20.pagehead%2C.RH%20.js-repo-meta-container%2C.RH%20.overall-summary%2C.RH%20.js-toggle-lang-stats%2C.RH%20.mt-2%2C.RH%20.mb-2%2C.RH%20.mb-3%2C.RH%20.d-flex%2C.RH%20.file-navigation%2C.RH%20.branch-infobar%2C.RH%20.commit-tease%2C.RH%20.file-header%2C.RH%20%23readme%3Eh3%2C.RH%20.px-2%2C.RH%20.f4%7Bdisplay%3Anone!important%7D.RH%20.file%2C.RH%20.Box%7Bborder%3A0%7D.RH%20.file-wrap%7Bleft%3A50%25%3Bmargin-left%3A-22.5rem%3Bposition%3Afixed%3Btop%3A0%3Btransform%3AtranslateY(-100%25)%3Btransition%3Atransform%20.5s%3Bwidth%3A45rem%3Bz-index%3A100%7D.RH%20.file-wrap%3Ahover%7Btransform%3AtranslateY(0)%7D.RH%20.file-wrap%3Aafter%7Bbackground%3A%23eee%3Bborder-radius%3A0%200%2050%25%2050%25%3Bcolor%3A%23fff%3Bcontent%3A%22%E2%97%8F%20%E2%97%8F%20%E2%97%8F%22%3Bposition%3Aabsolute%3Btext-align%3Acenter%3Bwidth%3A100%25

Keybase proof

I hereby claim:

  • I am stedman on github.
  • I am stedman (https://keybase.io/stedman) on keybase.
  • I have a public key whose fingerprint is AD40 7AFA 78AF 68DE F5C6 F84C FCCA E2FF C936 4FB4

To claim this, I am signing this object:

@stedman
stedman / js-under-pressure.js
Last active December 25, 2015 06:49
My answers for the http://toys.usvsth3m.com/javascript-under-pressure/ challenge. Please question/comment/improve!!
// 1
function doubleInteger(i) {
// i will be an integer. Double it and return it.
return i*2;
}
// 2
function isNumberEven(i) {
// i will be an integer. Return true if it's even, and false if it isn't.
@stedman
stedman / HTML.tmDelta
Created June 28, 2011 03:05
An improved TextMate hyperlink helper script for HTML that uses title for input if need be.
{ shellVariables = (
{ name = 'TM_LINK_FORMAT';
value = '<a href="<%= e_sn url %>"<%= "\${1: title=\"\${2:#{e_sn title}}\"}" if defined? title unless input.empty? %>>${3:<%= input.empty? ? "#{e_sn title}" : "#{e_sn input}" %>}</a>';
},
);
}