Skip to content

Instantly share code, notes, and snippets.

View shiftgeist's full-sized avatar
🪄
Conjuring CSS

Felix Hungenberg shiftgeist

🪄
Conjuring CSS
  • 04:59 (UTC +01:00)
View GitHub Profile
@shiftgeist
shiftgeist / random-redirect.userscript.js
Created December 4, 2024 14:51
Some websites are a time waste.
// ==UserScript==
// @name Random redirector
// @namespace Violentmonkey Scripts
// @match *://**/*
// @grant none
// @version 1.0
// @author shiftgeist
// @description 12/4/2024, 3:46:35 PM
// @run-at document-start
// ==/UserScript==
@shiftgeist
shiftgeist / gh-pr.js
Last active September 23, 2024 15:16
Userscript to hide github pull requests based on string in title or pr number.
// ==UserScript==
// @name Hide Github pr's
// @namespace shiftgeist custom Github script
// @match https://github.com/*/pulls*
// @icon https://github.com/fluidicon.png
// @grant GM.getValue
// @grant GM.setValue
// @version 1.1
// @author -
// @description 23/09/2024, 10:02:18
@shiftgeist
shiftgeist / lazyload.ts
Last active September 19, 2024 10:48
Minimal lazy load images
// Based on https://github.com/ApoorvSaxena/lozad.js
interface Options {
selector: string;
rootMargin: IntersectionObserverInit['rootMargin'];
threshold: IntersectionObserverInit['threshold'];
load(target: Element): void;
loaded(target: Element): void;
}
@shiftgeist
shiftgeist / yt-wl-quick-delete.js
Created August 29, 2024 13:35
Youtube Watch Later Quick Delete Button
// ==UserScript==
// @name Youtube Watch Later Quick Delete
// @namespace Violentmonkey Scripts
// @match https://www.youtube.com/playlist?list=WL
// @icon https://www.youtube.com/favicon.ico
// @grant none
// @version 1.0
// @author shiftgeist
// @description 29/08/2024, 14:41:36
// ==/UserScript==
@shiftgeist
shiftgeist / add-likes-to-playlist.js
Last active September 7, 2024 17:51
Soundcloud: Add all liked songs to playlist
// 1. Start on https://soundcloud.com/you/likes
// 2. Scroll all the way to the bottom (may only add 300 items at a time because of soundcloud api)
// (playlists are limited to 500 songs)
playlistName = 'Likes' // <== your playlist
list = Array.from(document.querySelectorAll('.badgeList__item .sc-button-more'))
console.log('Found', list.length, 'liked songs')
@shiftgeist
shiftgeist / timeout-promise.js
Last active March 6, 2024 11:21
setTimeout Promise
await new Promise(resolve => setTimeout(resolve, 1000));
@shiftgeist
shiftgeist / enum-const.ts
Created January 23, 2024 14:34
Enum with Const + Type
const Permission = {
Read: 'r',
Write: 'w',
Execute: 'x'
} as const;
type Permission = typeof Permission[keyof typeof Permission];
@shiftgeist
shiftgeist / vite.config.ts
Created January 9, 2024 12:21
Vite: Fetch package.json version
const fetchVersion = () => {
return {
name: 'html-transform',
transformIndexHtml(html) {
return html.replace(
/__APP_VERSION__/,
`v${process.env.npm_package_version}`
)
}
}
/**
* If a object has a property with Array<{ [key]: val }> and you want to make the array object values partial
*/
export type PartialByArray<T, K extends keyof T> = Exclude<T, K> & {
[key in K]: Array<{ [B in keyof T[K]]: Partial<T[K][B]> }>
}
@shiftgeist
shiftgeist / pog-star-repo.csv
Last active November 6, 2021 15:42
Collection of the best repositories that I stared (definitely not because I forget their names)
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 4 columns, instead of 3 in line 8.
Name,Description,Link,Quick Start
barrier,Open-source KVM software,https://github.com/debauchee/barrier,apt install barrier
based.cooking,A simple culinary website,https://github.com/LukeSmithxyz/based.cooking,based.cooking
Bundlephobia,Find the cost of adding a npm package to your bundle,https://github.com/pastelsky/bundlephobia,https://bundlephobia.com
catt,Cast All The Things allows you to send videos from many online sources to your Chromecast,https://github.com/skorokithakis/catt,python3 -m pip install catt
clean-code-javascript,🛁 Clean Code concepts adapted for JavaScript,https://github.com/ryanmcdermott/clean-code-javascript,https://github.com/ryanmcdermott/clean-code-javascript#introduction
entr,Run arbitrary commands when files change,https://github.com/eradman/entr,curl https://eradman.com/entrproject/code/entr-5.0.tar.gz -o entr-5.0
flameshot,Powerful yet simple to use screenshot software 🖥️ 📸,https://github.com/flameshot-org/flameshot,apt install flameshot
fzf,🌸 A command-line fuzzy finder,https:/