Skip to content

Instantly share code, notes, and snippets.

Avatar

Jake Bathman jakebathman

View GitHub Profile
@jakebathman
jakebathman / init.lua
Last active May 18, 2020
Hammerspoon config
View init.lua
-- Clear the console
hs.console.clearConsole()
-- 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
jakebathman / regex.md
Last active Jan 22, 2020
Laravel 5.8 deprecated helpers regex search
View regex.md
(array_add|array_collapse|array_divide|array_dot|array_except|array_first|array_flatten|array_forget|array_get|array_has|array_last|array_only|array_pluck|array_prepend|array_pull|array_random|array_set|array_sort_recursive|array_sort|array_where|array_wrap|camel_case|ends_with|kebab_case|snake_case|starts_with|str_after|str_before|str_contains|str_finish|str_is|str_limit|str_plural|str_random|str_replace_array|str_replace_first|str_replace_last|str_singular|str_slug|str_start|studly_case|title_case)
@jakebathman
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"},
View long-url-test.md

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vitae enim sollicitudin, placerat arcu vitae, https://www.amazon.com/Razor-15120040-Pocket-Rocket-Blue/dp/B001PH9J1I/ref=sr_1_1?keywords=razor+pocket+rocket&qid=1565972694&s=gateway&sr=8-1 tristique urna. Duis vitae commodo felis. Morbi tincidunt magna at turpis porttitor maximus.

Vivamus fermentum rutrum enim vitae ultrices. Pellentesque ac https://www.amazon.com/Razor-15120040-Pocket-Rocket-Blue/dp/B001PH9J1I/ref=sr_1_1?keywords=razor+pocket+rocket&qid=1565972694&s=gateway&sr=8-1 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
jakebathman / log.md
Created Jan 17, 2020 — forked from mattstauffer/log.md
Introduction to GistLog
View log.md

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 https://gistlog.co/your-github-username/gist-id
  4. If you want to have your own GistLog landing page (e.g. gistlog.co/mattstauffer), [read all about it](https://gistlog.co/mattstauffer/a82db5
@jakebathman
jakebathman / get_placeholder_images.sh
Created Nov 19, 2019
Get three placeholder images of set sizes, with random filenames
View get_placeholder_images.sh
#!/bin/sh
# Set a few variables
SIZE_M=(750 422)
SIZE_T=(1536 864)
SIZE_D=(2780 1564)
BASE="https://picsum.photos"
# Move to the download folder
cd ~/Downloads
@jakebathman
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.
@jakebathman
jakebathman / dssh.sh
Last active May 8, 2019
"SSH" into one of your running docker containers
View dssh.sh
#! /bin/bash
## Setup note:
## Add execution permissions to this file using:
## chmod u+x dssh.sh
unset options i o
opt=( $(docker ps --format '{{.Names}}' | sort | awk '{print v++,$1}') )
# Show the user a list of containers to pick from
@jakebathman
jakebathman / karabiner.json
Created Mar 20, 2019
Karabiner rule for double-press left shift -> caps lock
View karabiner.json
{
"description": "Double left shift to caps_lock",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": ["any"]
}
@jakebathman
jakebathman / giscus_62.test
Created Jan 2, 2019
Test for giscus bugfix (PR #62)
View giscus_62.test
This is a gist to test that Giscus is working as expected.
I will comment on this using another GitHub account in about a minute.
You can’t perform that action at this time.