Skip to content

Instantly share code, notes, and snippets.

View gerwitz's full-sized avatar
🌲

Hans Gerwitz gerwitz

🌲
View GitHub Profile
@ljw1004
ljw1004 / you_are_not_right.sh
Last active November 19, 2025 17:05
A UserPromptSubmit hook for Claude Code to stop it saying "You're right"
#!/bin/bash
set -euo pipefail
trap 'echo "at line $LINENO, exit code $? from $BASH_COMMAND" >&2; exit 1' ERR
# This is a Claude Code hook to stop it saying "you are right".
#
# Installation:
# 1. Save this script and chmod +x it to make it executable.
# 2. Within Claude Code, /hooks / UserPromptSubmit > Add a new hook (this file)
#
@JakubMarcinkowski
JakubMarcinkowski / table-copier.user.js
Created August 24, 2022 06:13
Userscript for Tampermonkey (maybe for other managers too). It just copy a table to clipboard. Pasteable into spreadsheets.
// ==UserScript==
// @name Table copier
// @version 0.1
// @description Copy a table to clipboard. Pasteable into spreadsheets.
// @author Jakub Marcinkowski <kuba.marcinkowski on g mail>
// @match http*://*/*
// @grant GM_registerMenuCommand
// @grant GM_setClipboard
// ==/UserScript==
@dave-cross
dave-cross / .eleventy.js
Last active April 13, 2020 23:30
A basic Image Sharp transformer for 11ty
const { JSDOM } = require("jsdom");
const responsiveImage = require("./src/js/responsive-image");
// Set the project root for use with Sharp.
global.__rootdir = __dirname;
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("img");
eleventyConfig.addTransform("transform-sharp", async function(
@mcevskb
mcevskb / trakt-remove-history.js
Last active July 30, 2025 18:50 — forked from hugoboos/trakt-remove-history.js
Remove duplicate episodes from Trakt
// Run in console on the history page (http://trakt.tv/users/<username>/history)
// Will remove all the duplicate episodes, on that page, from the watched history.
var episodesRemoved = []
// episodeItems = $("[data-type=episode]")
episodeItems.each(function(){
var $this = $(this);
var episodeId = $this.data('episode-id')
var showId = $this.data('show-id')
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active November 30, 2025 16:27
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@robfletcher
robfletcher / TumblrToMiddleman.groovy
Last active November 5, 2019 14:15
Scrape markdown posts from a Tumblr blog and export for Middleman
/*
* This script will scrape text posts from a Tumblr blog and export them as `.md`
* files with YAML frontmatter ready to be used in a Middleman blog.
*
* Aliases are added for the _middleman-alias_ gem so Tumblr style URLs like
* `/post/{id}/{slug}` will redirect to the Middleman-style URL.
*
* Although I built this for migrating to Middleman it should be pretty easy to
* adapt this for any similar static site generator.
*/
@kylemcdonald
kylemcdonald / Matlab.pde
Last active August 29, 2015 14:02
Lomb-Scargle periodogram for Processing, ported from Matlab code, so it's very idiosyncratic and non-idiomatic. Original code published in "Ice Ages and Astronomical Causes: Data, Spectral Analysis and Mechanisms" available at http://books.google.com/books?id=P8ideTkMQisC&pg=PA289&dq=spectral+lomb+scargle&hl=en
float[] hann(float[] x) {
int n = x.length;
float[] result = new float[n];
for(int i = 0; i < n; i++) {
float weight = .5 * (1 - cos((TWO_PI * i) / (n - 1)));
result[i] = x[i] * weight;
}
return result;
}
int[][] result;
float time;
void setup() {
setup_();
result = new int[width*height][3];
}
void draw() {
for (int i=0; i<width*height; i++)
@sonderingheights
sonderingheights / svg-primer.md
Last active August 29, 2015 13:57
Oh wow, I can has SVG in my work now? Just some beginner hoarding some links up.
@dbreunig
dbreunig / ReporterSaveFileDescription.md
Last active January 22, 2021 16:07
A description of the data written to the Reporter App Dropbox save folder.

#Reporter Save File Schema

##The Reporter Export File

Reporter saves to your Dropbox account with plaintext JSON files, one for each day. When a Report is entered in the app a file is created for that day if it does not exist. Otherwise, the report is appended to the existing file. The save folder is located in 'Dropbox/Apps/Reporter-App/'.

Reporter save files are named according to the following convention:

YYYY-MM-DD-reporter-export.json