Skip to content

Instantly share code, notes, and snippets.

View JellyWX's full-sized avatar
💙
Idle

Jude Southworth JellyWX

💙
Idle
View GitHub Profile
@JellyWX
JellyWX / filterlist
Created December 7, 2023 08:20
Custom uBlock filter list
||accounts.google.com/gsi/iframe/select$subdocument
codesandbox.io
@JellyWX
JellyWX / search.brave.js
Last active April 18, 2024 08:08
Tampermonkey Userscripts
// ==UserScript==
// @name Remove summarizer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://search.brave.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=brave.com
// @grant none
// ==/UserScript==
@JellyWX
JellyWX / jude.goggles
Last active October 24, 2023 07:24
Brave Search goggle file
! name: jude
! description: Goggle for my own search results
! public: false
! author: Jude S
! tlds
*.uk$boost=1
*.org$boost=1
! everyday sites
@JellyWX
JellyWX / pre-commit
Created September 8, 2022 07:37 — forked from mgershovitz/pre-commit
Git pre-commit hook to prevent accidentally committing debug code (add NO_COMMIT in source comment)
#!/bin/bash
if git diff --cached | grep '^[+d].*NO_COMMIT'; then
echo "Can't commit file with NO_COMMIT comment, remove the debug code and try again"
exit 1
fi
@JellyWX
JellyWX / forms.py
Created July 31, 2019 11:10
Small form modelling system for Flask
import typing
from werkzeug.security import generate_password_hash, check_password_hash
from werkzeug import ImmutableMultiDict
class Field():
class FieldLengthExceeded(Exception):
pass
class MissingFieldData(Exception):
pass
@JellyWX
JellyWX / profanity.regex
Created May 23, 2019 20:40
A regex of many profanities
nig[^(h|n|m)]
n.{0,3}gg
n(.)\1{0,}gg
f.{1}g
(c|k)(u|v)\1{0,}nt
(c|k)r.?.?k.?r
f(.)\1{0,}(k|ck){1,2}
d(i|1|y)\1{0,}(ck|k)
(c|k)(0|o|u)\1{0,}ck
sh(i|1)\1{0,}t
def bucket_sort(vector: list, bin_count: int):
bins = [[] for _ in range(bin_count)] # create a list of empty lists to the bin_count
# define the maximum, minimum and range of values within the data being sorted
M, m = max(vector), min(vector)
r = M - m
# group the items into bins
for item in vector:
#include "bubble_sort.h"
void bubble_sort(int *array, int buffer_len)
{
bool sorted = true;
for (int i = 0; i < buffer_len; ++i)
{
sorted = true;
for (int j = 0; j < buffer_len - i - 1; ++j)
{
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#define RESET "\x1B[0m"
#define BLOCK "█"
import random
BIN_SIZE = 26
OBJECT_COUNT = 3000
MAX_OBJECT_SIZE = 25
assert MAX_OBJECT_SIZE <= BIN_SIZE # check that objects cannot be too big
class Result(): # custom result class for handling errors
def __init__(self, err=None, ok=None, ):