Skip to content

Instantly share code, notes, and snippets.

View codelahoma's full-sized avatar

Rod Knowlton codelahoma

View GitHub Profile
@codelahoma
codelahoma / dynamic_lcel_inputs
Last active March 22, 2024 17:02
Dynamic LCEL Inputs
{
"cells": [
{
"cell_type": "markdown",
"id": "9eaf7e95-0591-4c8a-95f5-3c9355b62807",
"metadata": {},
"source": [
"# Dynamic production of LCEL inputs\n",
"\n",
"In some situations, you might want to use LCEL to run multiple runnables in parallel to produce inputs for another runnable that follows it.\n",
@codelahoma
codelahoma / README.md
Last active November 11, 2023 13:29
Automatically generate summaries of YouTube videos with transcriptions, using OpenAI's language model and create Markdown files with the output.

(DEFUNCT - NO LONGER WORKS) YouTube Video Summarizer (yt_summarize.py)

This gist contains a Python script that generates a transcript or summary of a YouTube video. It fetches video information, transcribes the audio using the Whisper ASR model, and generates a summary using the OpenAI language model.

Features

  • Fetch YouTube video information (title, description, channel title, etc.)
  • Transcribe video audio
  • Generate a summary of the video transcript
  • Save output as a markdown file
{
"packages" : [
{
"email" : "jesse@keyboard.io",
"help" : {
"online" : "https://kaleidoscope.readthedocs.io"
},
"maintainer" : "Keyboardio",
"name" : "keyboardio",
"platforms" : [
@codelahoma
codelahoma / IWasWatchingThat.vbs
Created May 22, 2019 19:23
Quick and Dirty 'Caffeine' for Windows
Dim WshShell
Set WshShell = Wscript.CreateObject("WScript.Shell")
Do While True
WshShell.SendKeys("{F15}")
WScript.Sleep(55000)
Loop
#!/bin/bash
brew_command=/usr/local/bin/brew
brew_cask_command="$brew_command cask"
echo '#!/bin/bash'
echo ''
echo 'trap ctrl_c INT'
echo 'function ctrl_c() {'
echo 'echo "** Trapped CTRL-C"'
@codelahoma
codelahoma / task_tests.py
Last active December 6, 2018 20:22
how to check that a method wasn't called on a fudge mock
get_was_called = False
def fake_get():
nonlocal get_was_called
get_was_called = True
mock_equip_obj.provides('get').calls(fake_get)
# interaction that shouldn't call `get`
import xml.etree.ElementTree as ET
print(ET.tostring(client.history.last_sent['envelope']))
@codelahoma
codelahoma / oh-noes.py
Last active June 22, 2018 18:43
oh noes ascii art
from fabric.colors import red, green
def _happy():
print(green('\nLooks good from here!\n'))
def _sad():
print(red(r'''
___ ___
@codelahoma
codelahoma / caps-to-ctrl.reg
Created December 22, 2017 14:55
Map Capslock to Ctrl for windows
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,3a,00,1d,00,1d,00,3a,00,00,00,00,00
@codelahoma
codelahoma / grok_vi.mdown
Created October 12, 2017 20:29 — forked from nifl/grok_vi.mdown
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)