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 formatDate(date = new Date()) { | |
| return date.toISOString().split("T")[0]; | |
| } | |
| function escapeMarkdown(text) { | |
| return text | |
| .replace(/\\/g, "\\\\") | |
| .replace(/\*/g, "\\*") | |
| .replace(/_/g, "\\_") |
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
| // WORKS AS OF 6/18/2025; Maciej Kos | |
| // == Enhanced Chat Exporter == | |
| // | |
| // Purpose: | |
| // This script is designed to be run in the browser's Developer Tools console on a chat page. | |
| // Its primary goal is to export the entire chat history, including both user messages and | |
| // bot responses, into a formatted text block that can be easily copied to the clipboard. | |
| // | |
| // Features: |
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
| import jwt from '@tsndr/cloudflare-worker-jwt' | |
| // Add following config to wrangler.toml | |
| // | |
| // r2_buckets = [ | |
| // { binding = "STORAGE_BUCKET", bucket_name = "your_bucket_name" } | |
| // ] | |
| // | |
| // Also requires download_jwt_secret in the worker env |
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
| """ | |
| Convert YouTube subtitles(vtt) to human readable text. | |
| Download only subtitles from YouTube with youtube-dl: | |
| youtube-dl --skip-download --convert-subs vtt <video_url> | |
| Note that default subtitle format provided by YouTube is ass, which is hard | |
| to process with simple regex. Luckily youtube-dl can convert ass to vtt, which | |
| is easier to process. |
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
| #!/usr/bin/env bash | |
| # FFMETADATA Chapter generator | |
| # Pass multiple media files to this script to generate a generic FFMETADATA file | |
| # Usage: ARTIST="My Artist" ALBUM="My Album" ./chapters.sh /path/to/*.wav > my.metadata | |
| set -eo pipefail | |
| ARTIST="${ARTIST:-ARTIST}" | |
| ALBUM="${ALBUM:-ALBUM}" | |
| end_stamp=0 | |
| begin_stamp=0 | |
| i=1 |
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
| # Not Great PNG class. This is a very simple example of writing a PNG. It | |
| # only supports colors from the color palette stored in `@palette`. This is | |
| # meant to be example code, but I am using it in a program for visualizing | |
| # heap dumps from Ruby. | |
| # | |
| # This is free and unencumbered software released into the public domain. | |
| # | |
| # Anyone is free to copy, modify, publish, use, compile, sell, or | |
| # distribute this software, either in source code form or as a compiled | |
| # binary, for any purpose, commercial or non-commercial, and by any |
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
| <%%= form_with(model: <%= model_resource_name %>, local: true) do |form| %> | |
| <div class="card mb-4"> | |
| <div class="card-body"> | |
| <%% if <%= singular_table_name %>.errors.any? %> | |
| <div id="error_explanation" class="alert alert-danger"> | |
| <h2 class="h4"><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2> | |
| <ul> | |
| <%% <%= singular_table_name %>.errors.full_messages.each do |message| %> | |
| <li><%%= message %></li> |
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
| queue = Sidekiq::Queue.new("default") | |
| queue.each do |job| | |
| if job.klass == "DailyFrequencyCreatorWorker" | |
| DailyFrequencyCreatorWorker.set(queue: 'daily_frequency_creator').perform_async(*job.args) | |
| job.delete | |
| end | |
| end;nil |
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
| """ | |
| Convert YouTube subtitles(vtt) to human readable text. | |
| Download only subtitles from YouTube with youtube-dl: | |
| youtube-dl --skip-download --convert-subs vtt <video_url> | |
| Note that default subtitle format provided by YouTube is ass, which is hard | |
| to process with simple regex. Luckily youtube-dl can convert ass to vtt, which | |
| is easier to process. |
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
| #!/bin/bash | |
| for file in $(find . -type f); | |
| do | |
| git blame --date=format:%Y%m%d $file | |
| done | sed -e 's/.*\s\([0-9]\{8\}\)\s.*/\1/' | sort -r | tail |
NewerOlder