Skip to content

Instantly share code, notes, and snippets.

View seanr's full-sized avatar

Sean Robertson seanr

View GitHub Profile
@seanr
seanr / traceroute.usgs.txt
Created May 18, 2021 02:57
traceroute astrogeology.usgs.gov
$ traceroute astrogeology.usgs.gov 10:40:40 PM
traceroute to astrogeology.resolve-esas.usgs.gov (137.227.242.5), 64 hops max, 52 byte packets
1 192.168.0.1 (192.168.0.1) 6.067 ms 10.287 ms 11.210 ms
2 cpe-24-90-88-1.nyc.res.rr.com (24.90.88.1) 15.474 ms 26.904 ms 20.660 ms
3 be63.nydbny7002h.nyc.rr.com (68.173.202.118) 13.036 ms 15.314 ms 16.343 ms
4 agg111.nyquny9101r.nyc.rr.com (68.173.198.106) 24.757 ms 15.294 ms 20.422 ms
5 bu-ether25.nycmny837aw-bcr00.tbone.rr.com (107.14.19.22) 17.327 ms
bu-ether15.nycmny837aw-bcr00.tbone.rr.com (66.109.6.76) 21.812 ms
bu-ether25.nycmny837aw-bcr00.tbone.rr.com (107.14.19.22) 20.048 ms
6 ae-15-210.pr0.lax10.tbone.rr.com (66.109.9.5) 63.459 ms 29.359 ms
@seanr
seanr / AttributeGenerator.php
Created December 16, 2020 20:23
Attribute Generator
<?php
use Drush\Drush;
use Drupal\commerce_product\Entity\ProductAttributeValue;
use Symfony\Component\Yaml\Yaml;
$yml = file_get_contents('/app/config/templates/commerce-attributes/attributes.yml');
$attributes = Yaml::parse($yml);
// For each attribute
foreach ($attributes as $attribute) {
@seanr
seanr / sourcetree-crash.txt
Created December 7, 2020 19:45
Sourcetree crash: There are 2 items on the pasteboard, but 1 drag images
Process: Sourcetree [66133]
Path: /Applications/SourceTree.app/Contents/MacOS/Sourcetree
Identifier: com.torusknot.SourceTreeNotMAS
Version: 4.0.2 (236)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Sourcetree [66133]
User ID: 501
Date/Time: 2020-12-07 14:37:12.381 -0500
@seanr
seanr / Bforartists UV crash.txt
Created August 1, 2020 23:41
Blender UV Editing crash dump
Process: Bforartists [5318]
Path: /Users/USER/*/Bforartists.app/Contents/MacOS/Bforartists
Identifier: org.blenderfoundation.blender
Version: 2.90.0 (2.90.0 2020-07-06)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Bforartists [5318]
User ID: 501
Date/Time: 2020-08-01 18:47:31.307 -0400
@seanr
seanr / daycount.fish
Created April 25, 2020 22:36
Simple fish shell command to give a daycount between YYYY-MM-DD and now.
# Print the number of days between a given date or the default date and the current date.
#
function daycount
# Default date.
set DATE "2020-02-17"
# Test for presence and formatting of argument.
if count $argv > /dev/null
if string match -qr '^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$' $argv
set DATE $argv
@seanr
seanr / config.fish
Created January 1, 2020 22:49
Fish-compatible blt alias/function
function blt
if eval [[ ! -z {$AH_SITE_ENVIRONMENT} ]]
set PROJECT_ROOT "/var/www/html/{$AH_SITE_GROUP}.{$AH_SITE_ENVIRONMENT}"
else if [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ];
set PROJECT_ROOT "git rev-parse --show-cdup"
else
set PROJECT_ROOT "."
end
if [ -f "$PROJECT_ROOT/vendor/bin/blt" ]
# Pantheon recipe
name: [example]
# Start with the default Pantheon recipe
recipe: pantheon
# Configure the Pantheon recipe
config:
# Optionally specify the type of Pantheon site this is. If ommitted this will
@seanr
seanr / 0_reuse_code.js
Created June 16, 2017 18:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env sh
set -e
# Load variables.
source "$(dirname $0)/_vars"
usage() {
echo "Build the application."
echo " "
echo "./scripts/docker/build [options]"
#!/usr/bin/env bash
# Checkout a local branch and build a Pantheon multi-dev environment from it.
set -e
# Load variables.
source "$(dirname "$0")/_vars"
# Clean up the build.
cleanup() {
if [[ -d ${RELEASE_DIRECTORY} && ${RELEASE_DIRECTORY} == *"pantheon"* && -d ${CURRENT_DIRECTORY} && ! -z ${GIT_CURRENT_BRANCH} ]]; then