Skip to content

Instantly share code, notes, and snippets.

View mattstabeler's full-sized avatar

Matt Stabeler mattstabeler

View GitHub Profile
@mattstabeler
mattstabeler / copy-to-clipboard.html
Last active January 28, 2022 12:51
Copy data to clipboard
<button data-clipboard-copy-content="copy this content">Copy</button>
@mattstabeler
mattstabeler / curl_headers
Last active August 26, 2021 12:42
A simple alias for pulling out headers for HTTP requests
#!/bin/bash
if [ -z $1 ];
then echo "Missing url, try $0 http://example.com";
else
curl -v -s $1 1> /dev/null
fi
## based on https://lornajane.net/posts/2014/view-only-headers-with-curl
@mattstabeler
mattstabeler / Epsonp600Marrutt_cheat-sheet.md
Last active December 2, 2020 16:02
A gist to help get the correct settings for each paper type on the Epson P600 printer

Marrutt Papers and ProHD Inks

For the Epson P600 printing from a Mac in either Adobe Colour Printer Utility, or Adobe Lightroom Classic.

Marrutt 280gsm Traditional Baryta Hi-White Semi Gloss Paper

On the printer: Premium Luster
In print settings: Ultra Premium Photo Luster
@mattstabeler
mattstabeler / Docker Composer Apache PHP wordpress setup.md
Last active July 28, 2020 11:14
Apache PHP Docker Compose for Wordpress

docker-compose build www

docker-composer up -d wpdb redis www

#!/bin/zsh
# Alias this to your ~/bin/ directory: `ln -s ~/git/dcp/dcp.sh ~/bin/dcp
# and `chmod +x ~/git/dcp/dcp.sh`
# docker-compose "$@"
docker compose "$@"
@mattstabeler
mattstabeler / gist:c4cf0bc2a8d56b88d3f68a6bbc8c8100
Created May 14, 2018 14:34
In each subdir - set the git email address
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git config user.email you@example.co.uk" \;
@mattstabeler
mattstabeler / delete_slack_files.py
Last active August 30, 2018 03:39
Python script to delete your old files from slack
#!/usr/local/bin/python
import urllib, json, time
# find files older than X and delete them
# https://api.slack.com/docs/oauth-test-tokens
token = "your-token-here"
# https://api.slack.com/methods/users.identity looks like "U2XXXXXXX"
user = "your-user-id"
@mattstabeler
mattstabeler / giffy.sh
Created December 15, 2016 17:05
convert a movie file to a gif
#!/bin/bash
# assumes you have ffmpeg - brew install ffmpeg
if [ -z "$1" ]; then
echo "No input file"
exit
fi
if [ -z "$2" ]; then
echo "No output file"
exit
fi
@mattstabeler
mattstabeler / iframe-resizer.ts
Last active August 21, 2018 17:46
iFrame resizer (consumer) for angular 2
// add this directive to an iFrame element and pass a name of the source, and this will change the height based on the
// events passed from the iframe source. the name of the source, and type of the message are checked before making a
// change to the element width.
// expects an object like to have been sent through the window.postMessage() interface :
// {
// type: 'resize',
// source: 'some-iframe-content',
// value: {
// height: 200