Skip to content

Instantly share code, notes, and snippets.

View erquhart's full-sized avatar

Shawn Erquhart erquhart

  • USA
View GitHub Profile
@erquhart
erquhart / selection-command.js
Last active February 29, 2024 10:31
Text selection commands for Cypress.io
/**
* Credits
* @Bkucera: https://github.com/cypress-io/cypress/issues/2839#issuecomment-447012818
* @Phrogz: https://stackoverflow.com/a/10730777/1556245
*
* Usage
* ```
* // Types "foo" and then selects "fo"
* cy.get('input')
* .type('foo')
@erquhart
erquhart / 1-setup.md
Created October 30, 2023 20:52 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS

Methods of Signing with a GPG Key on MacOS

Last updated September 21, 2022

This Gist explains how to do this using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

There has been a number of comments on this gist regarding some issues around the pinentry-program and M1 Macs. I've finally gotten a chance to try things out on an M1 and I've updated the documentation in 2-using-gpg.md to reflect my findings.

@erquhart
erquhart / staticgen-archive.json
Last active February 10, 2020 21:51
STATICGEN.COM DATA ARCHIVE
[[1581371477076,[{"id":"ace","s":37,"fk":6,"i":0},{"id":"acrylamid","s":284,"fk":41,"i":43},{"id":"adm-dev-kit","s":29,"fk":4,"i":11},{"id":"amsf","s":247,"fk":142,"i":12},{"id":"anodize","s":4,"fk":0,"i":1},{"id":"antora","f":633,"s":225,"fk":86,"i":165},{"id":"antwar","s":461,"fk":32,"i":7},{"id":"asimov-static","s":4,"fk":3,"i":0},{"id":"assemble","s":3759,"fk":264,"i":29},{"id":"awestruct","s":269,"fk":81,"i":54},{"id":"bake","s":32,"fk":7,"i":0},{"id":"bakeit","s":2,"fk":2,"i":1},{"id":"baker","s":41,"fk":7,"i":1},{"id":"bang","s":8,"fk":1,"i":0},{"id":"bashblog-ng","s":13,"fk":3,"i":0},{"id":"bashblog","s":905,"fk":147,"i":22},{"id":"blackhole","s":112,"fk":10,"i":1},{"id":"blacksmith","s":564,"fk":42,"i":27},{"id":"blended","s":16,"fk":2,"i":2},{"id":"blo","s":9,"fk":4,"i":1},{"id":"blog.sh","s":8,"fk":1,"i":0},{"id":"blogc","s":122,"fk":9,"i":3},{"id":"blogdown-r","s":1079,"fk":248,"i":13},{"id":"blogdown","s":17,"fk":1,"i":9},{"id":"blogo","s":16,"fk":6,"i":5},{"id":"blogofile","s":336,"fk":89,"i":45
@erquhart
erquhart / observeStyles.js
Last active July 11, 2019 15:48
Parse stylesheets over time, Eg. for detecting CodeMirror themes dynamically.
import { uniq, reduce, map, filter, debounce, sortBy, difference } from 'lodash';
/**
* Watches for new stylesheets for a period of time, returns a unique list of
* pattern match captures from CSS selectors. Designed to handle a single
* capture group per match, so the resulting array of matches will always be
* strings. The observer is a singleton, callers should pass callbacks that will
* be called when new matches are found. Uses `MutationObserver` to watch for
* stylesheets in the document head. Accepts RegExp `pattern` and an options
* hash for `debounceLength`/`lifespan` in milliseconds, defaulting to 5000 and
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import React from 'react';
import { css, Global } from '@emotion/core';
/**
* Font Stacks
*/
@erquhart
erquhart / data.json
Last active August 16, 2018 09:57
Staticgen.org development caching
{"BrandonRomano/static-lite":{"17550":{"size":69,"stargazers_count":25,"watchers_count":25,"forks_count":5,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":25,"network_count":5,"subscribers_count":4}},"Frozen-Flask/Frozen-Flask":{"17550":{"size":323,"stargazers_count":510,"watchers_count":510,"forks_count":47,"open_issues_count":15,"forks":47,"open_issues":15,"watchers":510,"network_count":47,"subscribers_count":18}},"tightenco/jigsaw":{"17550":{"size":1678,"stargazers_count":730,"watchers_count":730,"forks_count":84,"open_issues_count":22,"forks":84,"open_issues":22,"watchers":730,"network_count":84,"subscribers_count":34}},"JavaEden/Orchid":{"17550":{"size":19747,"stargazers_count":5,"watchers_count":5,"forks_count":2,"open_issues_count":27,"forks":2,"open_issues":27,"watchers":5,"network_count":2,"subscribers_count":1}},"wiztools/stagen":{"17550":{"size":151,"stargazers_count":38,"watchers_count":38,"forks_count":19,"open_issues_count":1,"forks":19,"open_issues":1,"watchers":38,"network_count":19
@erquhart
erquhart / cache.json
Created February 14, 2018 07:35
HEADLESSCMS.ORG DATA CACHE
{
"timestamp": 1518593744342,
"data": [
{
"followers": 3637,
"twitter": "appernetic"
},
{
"followers": 2,
"twitter": "bowtie_io"
@erquhart
erquhart / remark-stringify-nested-ul-mdast.json
Last active June 29, 2017 18:35
Sample nested list MDAST
{
"type": "root",
"children": [
{
"type": "list",
"ordered": false,
"start": null,
"loose": false,
"children": [
{
function flatten(arr) {
return arr.reduce((acc, val) => acc.concat(Array.isArray(val) ? flatten(val) : val), []);
}
@erquhart
erquhart / erq
Last active November 7, 2016 19:37
#!/bin/bash
# terminate script on first nonzero exit code
set -e
# color vars
# http://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux
LIGHT_GRAY='\033[0;37m'
LIGHT_CYAN='\033[1;36m'
DEFAULT_COLOR=$LIGHT_GRAY