This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gcm | |
# Check if llm is installed, if not, install it | |
if not type -q llm | |
echo "'llm' is not installed. Attempting to install it using pip..." | |
if pip install llm | |
echo "'llm' installed successfully." | |
else | |
echo "Failed to install 'llm'. Please install it manually and try again." | |
return 1 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# But - just read and edit the code however you like | |
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
gcm() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"class": { | |
"0": "person", | |
"1": "bicycle", | |
"2": "car", | |
"3": "motorcycle", | |
"4": "airplane", | |
"5": "bus", | |
"6": "train", | |
"7": "truck", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# udp_recv_code.py -- receive UDP messages from any receiver, can be another CircuitPython device | |
# 24 Aug 2022 - @todbot / Tod Kurt | |
# cribbing from code at https://github.com/adafruit/circuitpython/blob/main/tests/circuitpython-manual/socketpool/datagram/ntp.py | |
import time, wifi, socketpool | |
from secrets import secrets | |
print("Connecting to WiFi...") | |
wifi.radio.connect(ssid=secrets['ssid'],password=secrets['password']) | |
print("my IP addr:", wifi.radio.ipv4_address) | |
pool = socketpool.SocketPool(wifi.radio) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
/*IE specific code path to prevent textarea being shown while dialog is visible.*/ | |
return clipboardData.setData("Text", text); | |
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { | |
var textarea = document.createElement("textarea"); | |
textarea.textContent = text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- autosave.lua | |
-- | |
-- Periodically saves "watch later" data during playback, rather than only saving on quit. | |
-- This lets you easily recover your position in the case of an ungraceful shutdown of mpv (crash, power failure, etc.). | |
-- | |
-- You can configure the save period by creating a "lua-settings" directory inside your mpv configuration directory. | |
-- Inside the "lua-settings" directory, create a file named "autosave.conf". | |
-- The save period can be set like so: | |
-- | |
-- save_period=60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- autosave.lua | |
-- | |
-- Periodically saves "watch later" data during playback, rather than only saving on quit. | |
-- This lets you easily recover your position in the case of an ungraceful shutdown of mpv (crash, power failure, etc.). | |
-- | |
-- You can configure the save period by creating a "lua-settings" directory inside your mpv configuration directory. | |
-- Inside the "lua-settings" directory, create a file named "autosave.conf". | |
-- The save period can be set like so: | |
-- | |
-- save_period=60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function, unicode_literals | |
from ctypes import windll | |
from dragonfly import (ActionBase, Choice, Grammar, IntegerRef, Key, | |
MappingRule, Mouse, Pause, Repeat) | |
from dragonfly.actions.keyboard import Keyboard, KeySymbols | |
KEYBOARD = Keyboard() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dragonfly import * | |
import nsformat | |
dictation_length = [] # for "scratch that" purposes | |
input_state = None | |
""" Note: if you pass in the input state into the function using the function action rather than just accessing it | |
from within the function using the fact that it is in global scope, the input state will not be updated | |
when you run the dictation command multiple times | |
To see what I mean note that in contrast to the approach here, the approach taken | |
at the following link does not update the state after each dictation utterance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------ | |
Grammar(chrome): 3 rules (1 exported, 0 imported): | |
- ChromeRule(chrome) 1571 | |
- Alternative(...) 1570 | |
- Compound('[<click_by_voice_options>] <numbers>') 376 | |
- Sequence(...) 375 | |
- Optional(...) 18 | |
- Choice(..., name='click_by_voice_options') 17 | |
- Compound('click') 2 (+ 1 trivial direct child) | |
- Compound('copy') 2 (+ 1 trivial direct child) |
NewerOlder