Skip to content

Instantly share code, notes, and snippets.

@gavrie
gavrie / gist:ebfad1920d7c300ff9b55d68839adbc2
Last active January 12, 2025 02:08
Building Consistent Artifacts from Multiple Git Repositories

The following is based on this prompt to Claude:

Design a solution to build artifacts from several Git repos that all use the same compiler flags. We do not want to use a central makefile for this. The repos are all built using a specific Docker image that includes all the build tools. How should we store and cache the artifacts, and retrieve the relevant versions?

I'll design a solution that focuses on consistency, reusability, and efficient artifact management. Here's a comprehensive approach:

  1. Compiler Flags Management:
# compiler-config.yaml (stored in a separate config repo)
compiler:
@shaoyanji
shaoyanji / duck.lua
Last active January 12, 2025 02:07
tgpt integration within neovim
#!/usr/bin/env luajit
-- Handle command-line arguments
local args = {...}
for i, v in ipairs(args) do
-- print("Argument " .. i .. ": " .. v)
end
-- Handle piped input
--local piped_input = io.stdin:read("*a")
--if piped_input and piped_input ~= "" then
-- print("Received piped input:", piped_input)
@av
av / Claude 3.5 Sonnet.md
Last active January 12, 2025 02:06
Cardputer Replies

I can help you create a darkroom timer using the M5Stack Cardputer and a relay unit. This will allow you to control an enlarger or other darkroom equipment. Here's a basic implementation:

#include <M5Cardputer.h>

// Pin definitions
const int RELAY_PIN = 38;  // Adjust this according to your relay connection
const int DEFAULT_TIME = 10;  // Default time in seconds

// Global variables
@andytriboletti
andytriboletti / social.py
Created January 8, 2025 19:12
Social media manager that integrates X, Instagram, LinkedIn, and uses local AI tools for content generation.
#open source code generated with Claude by Andy
#[email protected]
#The Postiz project is now AGPL.
#this code is public domain
import requests
import json
import time
from datetime import datetime
import schedule
@robin-collins
robin-collins / userscript.js
Last active January 12, 2025 02:04
Claude.ai-ChatDownloader - userscript to download claude.ai chats to a text file.
// ==UserScript==
// @name Claude.ai-ChatDownloader
// @namespace http://tampermonkey.net/
// @version 1.9
// @description Download all chats from Claude.ai as a single file
// @match https://claude.ai/*
// @match https://claude.ai/chats
// @match https://claude.ai/chat/*
// @grant GM_setValue
// @grant GM_getValue
@VictorTaelin
VictorTaelin / a_b_challenge.md
Last active January 12, 2025 02:04
A::B Prompting Challenge: $10k to prove me wrong!

CHALLENGE

Develop an AI prompt that solves random 12-token instances of the A::B problem (defined here), with 90%+ success rate.

RULES

1. The AI will be given a <problem/> to solve.

We'll use your prompt as the SYSTEM PROMPT, and a specific instance of problem as the PROMPT, inside XML tags. Example:

@dotcomboom
dotcomboom / Donkey Konga 2 Chart.RTrackTemplate
Last active January 12, 2025 02:03
Donkey Konga 2 Modding Guide
<TRACK
NAME Chart
PEAKCOL 32559202
BEAT -1
AUTOMODE 0
VOLPAN 0.4316101837015 0 -1 -1 1
MUTESOLO 0 0 0
IPHASE 0
PLAYOFFS 0 1
ISBUS 1 1
@Teutates
Teutates / repack-rootless.sh
Last active January 12, 2025 01:59
Rootless Repacker
#!/bin/sh
### Procursus 2
### INFO: Repacks deb as rootless with iphoneos-arm64 arch, moves legacy tweak dir to
### new directory, and resigns. Does not do any further modification.
set -e
if ! type dpkg-deb >/dev/null 2>&1; then
@zedeus
zedeus / following.py
Created September 2, 2019 21:06
Fetch Twitter following list
import requests, re, sys
url = "https://mobile.twitter.com/{}/following"
cursor = ""
usernames = []
first = True
if len(sys.argv) < 2:
print("Usage: python followers.py <username>")
quit(1)

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.