Skip to content

Instantly share code, notes, and snippets.

@gre
gre / easing.js
Last active June 27, 2024 15:37
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
'use strict';
const stateMap = new WeakMap();
function useState(key, init) {
const update = (v) => stateMap.set(key, v);
if (stateMap.has(key)) {
return [stateMap.get(key), update];
}
stateMap.set(key, init);
return [init, update];
@cmoog
cmoog / facebook-ad-killer.js
Last active April 2, 2023 01:17
facebook ad killer for uBlockOrigin
/// facebook-hide-sponsored.js
(() => {
"use strict";
const INTERVAL = 1500;
setInterval(() => {
let element = Array.from(
document.querySelectorAll(
`span[style="-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box"]`
)
).find(({ innerHTML }) => innerHTML.trim() === "Sponsored");
@cmoog
cmoog / kindle-highlight-exporter.md
Last active December 12, 2022 21:00
Kindle highlight parser and exporter

Simple script to export highlights from a Kindle.

Requirments

  • macOS host
  • Kindle plugged into Mac
  • Deno installed on Mac

Usage

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;
}