Skip to content

Instantly share code, notes, and snippets.

Avatar

Graham P Heath loadedsith

View GitHub Profile
@loadedsith
loadedsith / readme.md
Last active Apr 10, 2020
Save as JPG workflow instructions
View readme.md

I've been encountering more and more .heic and .webp files lately. It's great, these formats have significant advantages... And yet, some times you just want a JPG. I've come up with a pretty good solve. It presumes that you have imageMagick installed.

  1. Open Automator.app
  2. Choose to make a new "Quick Action"
  3. Workflow receives current "Image files" in "Finder.app"
  4. Add an action called "Run Shell Script"
  5. Configure action: Shell: /bin/bash, Pass input "as arguments"
  6. Paste this script
    for f in "$@"
View gist:df608cdcb9c819af22c9339896a461ef
Kaveri Ra was separated from her family at a young age. Having lived a nomadic lifestyle until that time, moving constantly from planet to plnet, she continued in that vein after her parents vanished.
She had been serving as a wilderness guide and hunter throughout out the Outerr Rim for most of her life, when she met Hethan Romund on an expedition to a ruin on an otherwise deserted world. Over the course of that expedition Romund was curious about Kaveri's uncanny knack for spotting trouble before it happened and understanding the local wildlife, even though she'd never vistied the planet before.
Ultimately, Romund revealed the truth: Kaveri was sensitive to the Force. and her usual abilities were only the least of what she could accomplish. Romund insisted that she was capable of much more -- but that Romund herself could not teach her.
@loadedsith
loadedsith / gist:7d75f7929295aaeb9574f9f36d78ea80
Created Aug 14, 2019
chunkwm send window to next display, wrapped
View gist:7d75f7929295aaeb9574f9f36d78ea80
id=$(chunkc tiling::query --monitor id);
count=$(chunkc tiling::query --monitor count);
next=$(expr $id % $count + 1)
chunkc tiling::window --send-to-monitor $next;
chunkc tiling::monitor -f $next
View gist:e65ebfb6d1c5cb424e807d7b191595cd
<select id="voiceSelected">
<option value="Ivy">Ivy [English - American]</option>
<option value="Joanna">Joanna [English - American]</option>
<option value="Joey">Joey [English - American]</option>
<option value="Justin">Justin [English - American]</option>
<option value="Kendra">Kendra [English - American]</option>
<option value="Kimberly">Kimberly [English - American]</option>
<option value="Salli">Salli [English - American]</option>
<option value="Nicole">Nicole [English - Australian]</option>
<option value="Russell">Russell [English - Australian]</option>
@loadedsith
loadedsith / keymap.c
Last active Jan 25, 2020
Backlight responds to layers
View keymap.c
bool has_layer_changed = true;
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
static uint8_t old_layer = 0;
if (old_layer != layer) {
has_layer_changed = true;
old_layer = layer;
}
@loadedsith
loadedsith / keymap.c
Created Sep 20, 2017
Matrix_scan_user backlight layer feedback
View keymap.c
# Does not work.
# [...]
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
switch (layer) {
case _LOWER:
if(get_backlight_level() != 2)
@loadedsith
loadedsith / keymap.c
Created Sep 20, 2017
process_record_user backlight feedback
View keymap.c
# Custom code begins on line 25.
# [...]
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
print("mode just switched to qwerty and this is a huge string\n");
set_single_persistent_default_layer(_QWERTY);
View TextMate Copy Current File Path, Project Relative.
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
if [ -z ${TM_PROJECT_DIRECTORY+x} ]; then
echo -n "$TM_FILEPATH" | pbcopy
echo "$TM_FILEPATH"'\n Absolute path copied to clipboard'
else
TM_PROJECT_DIRECTORY="$TM_PROJECT_DIRECTORY/"
echo -n "${TM_FILEPATH#$TM_PROJECT_DIRECTORY}" | pbcopy
@loadedsith
loadedsith / StripTimestamp.tmMacro
Created Jul 22, 2016
Strip YouTube Caption Timestamps with Textmate
View StripTimestamp.tmMacro
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>command</key>
<string>selectAll:</string>
</dict>
@loadedsith
loadedsith / captions.sbv
Created Jul 22, 2016
Youtube Sample Captions
View captions.sbv
0:00:04.120,0:00:05.319
magnetic tweets
0:00:05.319,0:00:09.889
is a job base lot detecting
0:00:09.889,0:00:12.929
Twitter it was created
0:00:12.929,0:00:16.359
You can’t perform that action at this time.