Skip to content

Instantly share code, notes, and snippets.

@pbinkley
pbinkley / omeka-s-item-media.rb
Created September 3, 2020 15:27
Omeka-S REST API: minimal working example of creating an item with uploaded image in Ruby
=begin
This is a working example of the use of the Omeka-S REST API to create an item
with an associated image. It assumes you've set the API endpoint (e.g.
http://localhost:8080/api) and the authentication keys as environment
variables.
Note that the o:media element is an array, and can contain multiple images
(with sequential 'file_index' values, which must match the 'file[x]' element
in the payload).
@chowder
chowder / README.md
Last active January 7, 2026 16:03
Exporting Microsoft Authenticator TOTP secrets

Background

Workplaces may enforce TOTP 2FA to be enabled Office 365 accounts, which require the Microsoft Authenticator app to be installed.

Regular TOTP applications (such as Aegis, Authy, or LastPass) cannot be used as Microsoft uses a proprietary scheme called phonefactor. Furthermore, the application requires Google Services Framework (GSF) to be installed (likely to provide device notifications), and will refuse to work when it is not present on the device.

Forunately, after the registration is complete, the underlying mechanism the app uses to generate TOTP codes is regular otpauth, and its secrets can be exported with a little bit of effort.

Extracting the keys

@asd8971
asd8971 / Youtube控制器(頻道、留言、影片).user.js
Created August 1, 2025 11:26
Youtube控制器(頻道、留言、影片) [壞了-備份用]
// ==UserScript==
// @name Youtube控制器(頻道、留言、影片)
// @namespace smallsupo
// @version 2.71
// @description block and highlight youtube video/comment by keyword、channel
// @description:zh-TW 阻擋/高亮 youtube影片/留評 (依頻道、關鍵字)
// @author smallsupo ([email protected])
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
@kRHYME7
kRHYME7 / Nvidia On Hyprland.md
Last active January 7, 2026 16:00
# Hyprland Environment Variables for NVIDIA and Intel Setups

Hyprland Environment Variables for NVIDIA and Intel Setups

I made this guide because I have a hybrid GPU. In some setup like HyDE, there is a chance that the environment variables are being set for NVIDIA ONLY setup.

Environment Variable NVIDIA Only Hybrid (NVIDIA+Intel) Intel Only Explanation / Notes
LIBVA_DRIVER_NAME,nvidia ✅ Use ❌ Avoid (use iHD or comment out) ❌ Avoid (use iHD) VA-API driver for NVIDIA. Causes issues on hybrid or Intel-only setups. Use iHD for Intel VA-API.
`LIBVA
@xthezealot
xthezealot / lyra.txt
Last active January 7, 2026 15:59
Lyra - AI Prompt Optimization Specialist
You are Lyra, a master-level AI prompt optimization specialist. Your mission: transform any user input into
precision-crafted prompts that unlock AI's full potential across all platforms.
## THE 4-D METHODOLOGY
### 1. DECONSTRUCT
- Extract core intent, key entities, and context
- Identify output requirements and constraints
- Map what's provided vs. what's missing
i
me
my
myself
we
our
ours
ourselves
you
your
// $ cc -o checker checker.c
// $ ./checker
// $ ffmpeg -i output-%02d.ppm -r 60 output.mp4
#include <stdio.h>
int main()
{
char buf[256];
for (int i = 0; i < 60; ++i) {
snprintf(buf, sizeof(buf), "output-%02d.ppm", i);
@minimaxir
minimaxir / CLAUDE.md
Created January 2, 2026 01:53
Python CLAUDE.md (20260101)

Agent Guidelines for Python Code Quality

This document provides guidelines for maintaining high-quality Python code. These rules MUST be followed by all AI coding agents and contributors.

Your Core Principles

All code you write MUST be fully optimized.

"Fully optimized" includes:

@minimaxir
minimaxir / CLAUDE.md
Created January 2, 2026 01:57
Rust CLAUDE.md (20260101)

Agent Guidelines for Rust Code Quality

This document provides guidelines for maintaining high-quality Rust code. These rules MUST be followed by all AI coding agents and contributors.

Your Core Principles

All code you write MUST be fully optimized.

"Fully optimized" includes:

# Create a new worktree and branch from within current git directory.
ga() {
if [[ -z "$1" ]]; then
echo "Usage: ga [branch name]"
exit 1
fi
local branch="$1"
local base="$(basename "$PWD")"
local path="../${base}--${branch}"