Skip to content

Instantly share code, notes, and snippets.

jakebathman / te-snippets-to-alfred.php
Created Jan 29, 2021
Convert TextExpander exported CSV file to an Alfred 4 snippets import file
View te-snippets-to-alfred.php
$input = $argv[1] ?? 'snippets.csv';
$file = fopen($input, 'r');
$outputDir = pathinfo($input, PATHINFO_FILENAME);
$snippetFiles = [];
// Make the temp output directory
if (! file_exists($outputDir)) {
View interview.php
$host = '';
$port = 7777;
$socket = fsockopen($host, $port);
if (! $socket) {
die('Error: connection not successful');
jakebathman / user-agents.txt
Last active Jan 8, 2021
A list of major user agent strings for different browsers and devices
View user-agents.txt
Chrome/Windows: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome/Windows: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome/Windows: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome/macOS: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome/Linux: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome/iPhone: Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.77 Mobile/15E148 Safari/604.1
Chrome/iPhone (request desktop): Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87 Version/11.1.1 Safari/605.1.15
Chrome/iPad: Mozilla/5.0 (iPad; CPU OS 14_3 like Mac OS X) AppleWebKit/605.1.1
jakebathman / init.lua
Last active May 18, 2020
Hammerspoon config
View init.lua
-- Clear the console
-- Set the default grid
hs.grid.MARGINX = 0
hs.grid.MARGINY = 0
hs.grid.GRIDWIDTH = 20
hs.grid.GRIDHEIGHT = 100
-- Also can be set using hs.grid.setGrid'20x100'
jakebathman /
Last active Jan 22, 2020
Laravel 5.8 deprecated helpers regex search
jakebathman / thats-no-moon.js
Created Jan 21, 2020
Get the current phase of the moon, and adjust a sprite for it
View thats-no-moon.js
const phases=[
{"sprite-x":123, "sprite-y":987, phase:"new"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-1"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-2"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-3"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-4"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-5"},
{"sprite-x":123, "sprite-y":987, phase:"wax-crescent-6"},
{"sprite-x":123, "sprite-y":987, phase:"quarter-1"},
{"sprite-x":123, "sprite-y":987, phase:"wax-gibbous-1"},

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vitae enim sollicitudin, placerat arcu vitae, tristique urna. Duis vitae commodo felis. Morbi tincidunt magna at turpis porttitor maximus.

Vivamus fermentum rutrum enim vitae ultrices. Pellentesque ac enim at sem aliquet convallis sit amet quis diam. Etiam sodales urna eget varius pretium. Vivamus id eros vehicula mauris auctor dictum sed rhoncus arcu. Pellentesque tincidunt magna lorem, et pretium mi rhoncus in. Mauris erat erat, elementum a congue ut, imperdiet quis turpis.

jakebathman /
Created Jan 17, 2020 — forked from mattstauffer/
Introduction to GistLog

So, you might be asking yourself, what is GistLog?

GistLog is a blogging "platform" for people who want to quickly write and publish content, in Markdown, and don't want to bother with yet another platform and yet another login and yet another group hoarding their content. With GistLog, you use your pre-existing GitHub login, you store the data in your own GitHub account, and you can publish with a single click.

Using GistLog

  1. Create a public gist with a single file using Markdown. Set the gist description to be the title of your blog post
  2. Copy the gist URL, and paste it into the text box on the GistLog create page
  3. Copy your resulting URL and share it as your blog post—note that it will be in the form of
  4. If you want to have your own GistLog landing page (e.g., [read all about it](
jakebathman /
Created Nov 19, 2019
Get three placeholder images of set sizes, with random filenames
# Set a few variables
SIZE_M=(750 422)
SIZE_T=(1536 864)
SIZE_D=(2780 1564)
# Move to the download folder
cd ~/Downloads
jakebathman / gist:37ad72ff16c1f3c65dfabc24bfd53b11
Created May 8, 2019
A new gist, that should get first-party notifications for comments
View gist:37ad72ff16c1f3c65dfabc24bfd53b11
Just a quick test! Hopefully comments work.