Skip to content

Instantly share code, notes, and snippets.

View HammyHavoc's full-sized avatar
🏠
Working from home

Hammy Havoc HammyHavoc

🏠
Working from home
View GitHub Profile
From 213d3c6d2460de4634157da304095d94c95d882e Mon Sep 17 00:00:00 2001
From: Antony Deepak Thomas <antonydeepak@gmail.com>
Date: Thu, 24 Apr 2025 14:38:46 -0700
Subject: [PATCH] Obsidian OneNote Hacks for importing large sections
---
src/formats/onenote.ts | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/formats/onenote.ts b/src/formats/onenote.ts
<?php
// A blogroll for WordPress
// To be used with the link manager plugin https://wordpress.org/plugins/link-manager/
// More info: https://josh.blog/2024/05/blogrolls
namespace Blogroll;
function custom_rewrite_rule() {

Ad-free Twitter

Inject this css snippet to remove all ads from your Twitter timeline.

div[data-testid="placementTracking"]:has(path[d="M19.498 3h-15c-1.381 0-2.5 1.12-2.5 2.5v13c0 1.38 1.119 2.5 2.5 2.5h15c1.381 0 2.5-1.12 2.5-2.5v-13c0-1.38-1.119-2.5-2.5-2.5zm-3.502 12h-2v-3.59l-5.293 5.3-1.414-1.42L12.581 10H8.996V8h7v7z"]) {
  display: none;
}
@surprisetalk
surprisetalk / hn-gpt-free.js
Created March 23, 2023 13:00
Userscript to hide any HackerNews story with "GPT" in its title.
// ==UserScript==
// @name HackerNews GPT-Free Feed
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hides any Hacker News story with "GPT" in its title.
// @author Taylor Troesh
// @include https://news.ycombinator.com/*
// @grant none
// ==/UserScript==
@clintkev251
clintkev251 / generic-backup.sh
Created July 28, 2022 00:06
Generic backup script which stops and restarts containers
#!/bin/bash
echo "-----Stopping containers-----"
docker stop $(docker ps -q)
echo "-----Creating archive-----"
tar -cf stacks.tar stacks
echo "-----Restarting containers-----"
docker start $(docker ps -a -q)
echo "-----Uploading backup-----"
rclone sync stacks.tar backblaze:some-bucket
echo "-----Upload complete, cleaning up-----"
@clintkev251
clintkev251 / backup
Created July 28, 2022 00:01
Simple backup user script for unraid + rclone
#!/bin/bash
echo "Starting backup of appdata"
rclone sync /mnt/user/Docker\ Backup backblaze:some-bucket/Docker\ Backup --transfers 1 --bwlimit 75M
echo "Starting backup of Shared Documentation"
rclone sync /mnt/user/Shared\ Documentation backblaze:some-bucket/Shared\ Documentation --bwlimit 75M
echo "Starting backup of Read Media"
rclone sync /mnt/user/Read_Media/Music backblaze:some-bucket/Read_Media/Music --bwlimit 75M
echo "Starting backup of Pictures"
rclone sync /mnt/user/Pictures backblaze:some-bucket/Pictures --bwlimit 75M
echo "Starting backup of Workdata"
@TheBoroer
TheBoroer / FusionIO on TrueNAS SCALE.md
Last active October 17, 2025 00:23
Making Fusion-IO devices work on TrueNAS SCALE 22.02.1 and up

FusionIO / Fusion-IO devices on TrueNAS SCALE

WARNING: This is unsupported and has potential to mess your system up. Proceed at your own risk.

Initial instructions were for 22.02.1 but also works for later versions with some additional steps. There's notes for each upgrade I've done at the end of the gist.

Note for v22.02.2:

  • there's a bug where it doesnt show fusionio disks at all under Storage > Disks. So I had to downgrade to 22.02.1 and it works fine.

Gist to gather found info about using Native Instruments Maschine in Linux. Idea is to document found code samples, to make better experience using NI Hardware in Linux. I own Maschine Mikro MK3 and couldn't find anything how to work with it.

Maschine mikro MK3, and Maschine MK3, and probably others(?), have "Midi mode", but its not read midi mode. Its emulated using virtual midi device. In other words, device in "midi mode" still doesn't send any midi messages over usb. It only gets colored different, and screen says "Midi Mode". It still sends the same messages as in non Midi Mode, only software (driver) emulates it to use as midi.

After some searching found these projects, which has some support for NI hardware:

@crabdancing
crabdancing / backup-mainrouter.lan
Created October 5, 2021 10:33
Automatically backup your OpenWRT router configuration to a local tarball under ~/Backups
#!/usr/bin/env bash
# script based on instructions from:
# https://openwrt.org/docs/guide-user/troubleshooting/backup_restore
router_hostname=mainrouter.lan
# Generate/update backup
ssh "$router_hostname" 'umask go=; sysupgrade -b /tmp/backup-${HOSTNAME}-$(date +%F).tar.gz'
@jameshwartlopez
jameshwartlopez / functions.php
Last active March 2, 2025 22:19
Remove/Hide add to cart button in Woocommerce if the user is not logged in
//Option One (if you decided to use Option Two then remove this function and its action hook)
function remove_add_cart_button(){
$isLoggedIn = is_user_logged_in();
if(false == $isLoggedIn){
//if the user is not login then remove add to cart button by removing the action hook
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
}
}
add_action('wp','remove_add_cart_button');