Skip to content

Instantly share code, notes, and snippets.

@Roardom
Roardom / qbit-fastresume-path-changer.py
Created December 7, 2021 15:55
Replace paths easily in qBittorrent .fastresume (useful when switching from windows to linux)
import os
import re
# Insert the path where you keep your fast resume files here.
# Make a backup first!!!
torrentsDir = r'/torrents/'
# Insert paths to be replaced here. Dictionary key is current path. Dictionary value is new path
# If left empty, the script will only detect paths
@endolith
endolith / finite_scroll.txt
Last active January 8, 2024 12:31
Adblock ublock kill infinite scrolling
! Title: Finite Scroll (kills infinite scrolling)
! Last modified: 2017-10-24
! Homepage: https://gist.github.com/endolith/72ac5e69e037be02b118adbedcdeac59
! This URL: https://gist.githubusercontent.com/endolith/72ac5e69e037be02b118adbedcdeac59/raw/finite_scroll.txt
! TODO: Add these scripts: https://infinite-scroll.com/
! Forbes infinite scroll (and all other AJAX)
@yinwang0
yinwang0 / chez-future.ss
Last active April 28, 2023 06:49
experimental implementation of future with Chez Scheme threads
(define-record fitem (result ready mutex cond))
(define future
(lambda (thunk)
(let ([item (make-fitem #f #f (make-mutex) (make-condition))])
(fork-thread
(lambda ()
(let ([result (thunk)])
(with-mutex (fitem-mutex item)
(set-fitem-result! item result)
@yinwang0
yinwang0 / adc-demo.c
Last active October 28, 2018 15:24
demo of using adc instruction to add a bignum
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
typedef int bigit;
typedef long int iptr;
void asm_add(xp, xl, yp, yl, zp) bigit *xp, *yp, *zp; iptr xl, yl;
{
function Add-EnvPath {
param(
[Parameter(Mandatory=$true)]
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
)
if ($Container -ne 'Session') {
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: