Skip to content

Instantly share code, notes, and snippets.

@velzie
velzie / manifest-v2-chrome.md
Last active November 11, 2024 17:49
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

@angeld23
angeld23 / vanished_tweet_recovery.user.js
Last active October 27, 2024 19:11
Vanished Tweet Recovery: Detects whenever a tweet mysteriously vanishes from your timeline for no reason and allows you to re-open it
// ==UserScript==
// @name Vanished Tweet Recovery
// @namespace https://d23.dev/
// @version 1.2
// @description Detects whenever a tweet mysteriously vanishes from your timeline for no reason and allows you to re-open it
// @author angeld23
// @match *://*.x.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=x.com
// @grant none
// ==/UserScript==
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@kkrypt0nn
kkrypt0nn / ansi-colors-discord.md
Last active October 31, 2024 21:33
A guide to ANSI on Discord

A guide to ANSI on Discord

Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.

Quick Explanation

To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:

\u001b[{format};{color}m
@unrealwill
unrealwill / collisionLSH.py
Created August 8, 2021 10:20
Proof of Concept : generating collisions on a neural perceptual hash
import tensorflow as tf #We need tensorflow 2.x
import numpy as np
#The hashlength in bits
hashLength = 256
def buildModel():
#we can set the seed to simulate the fact that this network is known and doesn't change between runs
#tf.random.set_seed(42)
model = tf.keras.Sequential()
@101arrowz
101arrowz / crc32.js
Last active October 30, 2024 00:50
Fast CRC32 in JavaScript
/**!
* Fast CRC32 in JavaScript
* 101arrowz (https://github.com/101arrowz)
* License: MIT
*/
// If you use this code, please link this gist or attribute it somehow.
// This code uses the Slice-by-16 algorithm to achieve performance
// roughly 2x greater than all other JS CRC32 implementations (e.g.
@corentinbettiol
corentinbettiol / README.md
Last active January 12, 2024 15:47
Tiny js code that will simulate a 3D view of your elements, like firefox used to do.
@stanographer
stanographer / README.md
Last active July 19, 2021 13:43 — forked from morinted/README.md
Remove TypeRacer Input limit

This script removes the input length limit which can trip up Plover users.

Simply install the script into TamperMonkey (Chrome) or GreaseMonkey (Firefox) and get racing.

The script was created by community member nimble

/*
* clang -O2 -s -lGL -ldl -shared fake_glvendor.c -fPIC -o fake_glvendor.so
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
@udayvunnam
udayvunnam / lru.js
Last active June 6, 2021 06:10
Least Recently Used cache - Implementing LRU cache in Javascript
class Node {
constructor(key, value, next = null, prev = null) {
this.key = key;
this.value = value;
this.next = next;
this.prev = prev;
}
}
class LRU {