Skip to content

Instantly share code, notes, and snippets.

View loadedsith's full-sized avatar

Graham P Heath loadedsith

View GitHub Profile
#!/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 / keymap.c
Created September 20, 2017 19:03
process_record_user backlight feedback
# 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);
@loadedsith
loadedsith / keymap.c
Created September 20, 2017 19:04
Matrix_scan_user backlight layer feedback
# 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
Last active November 10, 2020 18:24
Backlight responds to layers
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;
}
<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 / gist:7d75f7929295aaeb9574f9f36d78ea80
Created August 14, 2019 16:12
chunkwm send window to next display, wrapped
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
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 / readme.md
Last active January 8, 2021 17:45
Save as JPG workflow instructions

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 "$@"
@loadedsith
loadedsith / input.scss
Created September 16, 2020 18:45
Generated by SassMeister.com.
.foo {
.bar {
content: "a";
}
&.bar {
content: "b";
}
& .bar {
content: "c";
}
@loadedsith
loadedsith / input.scss
Created October 9, 2020 19:26
Generated by SassMeister.com.
.bz{
@media (min-width: 500px) {
padding-bottom: 100px;
padding-top: 85px;
}
padding-bottom: 60px;
padding-top: 70px;
}