Skip to content

Instantly share code, notes, and snippets.

View cocoastorm's full-sized avatar
😤
Doing my best to be unphased

Khoa Nguyen cocoastorm

😤
Doing my best to be unphased
  • Surrey, BC, Canada
View GitHub Profile
@tkrotoff
tkrotoff / #mockWindowLocation.ts
Last active June 5, 2024 13:46
Jest/Vitest mocks for JSDOM window.location & window.history
/* eslint-disable unicorn/no-null */
/*
* Resetting window.location between tests is unfortunately a hard topic with JSDOM.
*
* https://gist.github.com/tkrotoff/52f4a29e919445d6e97f9a9e44ada449
*
* FIXME JSDOM leaves the history in place after every test, so the history will be dirty.
* Also its implementations for window.location and window.history are lacking.
* - https://github.com/jsdom/jsdom/blob/22.1.0/lib/jsdom/living/window/Location-impl.js
// ==UserScript==
// @name @chaoticvibing Twitter Blue Nerd - twitter.com
// @namespace Violentmonkey Scripts
// @match *://*.twitter.com/*
// @match *://*.x.com/*
// @grant none
// @version 1.9.2
// @author @chaoticvibing - GH @busybox11
// @description 11/9/2022, 11:45:28 PM
// @updateURL https://gist.githubusercontent.com/busybox11/53c76f57a577a47a19fab649a76f18e3/raw
@robinst
robinst / twitter-archive-following-followers.md
Last active June 26, 2024 04:05
Twitter: How to archive your following/followers data (usernames, etc)

Twitter allows users to download parts of their data, see How to download your Twitter archive.

But what's not included in that data dump is the usernames/handles of the people that you follow or are following you. All you get is account IDs which is just an internal number and so a bit useless when it comes to archival.

Here's a way to get that data (you need to know how to run stuff in the terminal):

  1. Go to your Twitter profile in a desktop browser (Firefox or Chrome)
  2. Right click on page → Inspect → Network tab
  3. Click on the Following link (e.g. https://twitter.com/{yourusername}/following)
@DaniruKun
DaniruKun / whisper-transcribe.bash
Last active March 31, 2024 01:50
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@Druah
Druah / Emotes.md
Last active May 31, 2024 19:22
How to Enable 7TV, BetterTTV, and FrankerFaceZ Emotes for Newbs

This guide is slightly deprecated as V3 of 7TV's browser add-on now supports 7TV, BetterTTV, and FrankerFaceZ emotes out of the box, and has some great quality of life chat features that are currently not found in any other emote add-on. You should consider going to 7TV's website and downloading their browser add-on from there.

What even is this? FeelsDankMan

7TV, BetterTTV, and FrankerFaceZ, more commonly stylized as 7TV, BTTV, and FFZ, are 3rd party emote services for Twitch chat, which aim to enhance a viewer's chatting experience on Twitch by allowing for more emotes to be used in chat, free of charge. Think of it like Discord emojis.

If you're wondering what those weird phrases people in chat seem to be spamming are, it's probably an emote from one of the above mentioned 3rd party emote servi

const ls = window.localStorage;
// Ensure we're always sending something
let stringifiedData = '{}';
// Default to production
let url = 'https://www.nytimes.com/games/wordle'
// Don't attempt unless our user has local storage enabled
if (ls) {
const errors = [];
const localData = {
@Xifax
Xifax / lofi.sh
Last active November 16, 2023 23:05
Updated script for playing different lofi stations (MacOS)
#!/bin/sh
# Requires https://formulae.brew.sh/formula/choose
# Requires https://formulae.brew.sh/cask/mpv
# Chmod +x lofi.sh and put it somewhere in $PATH
# May also set global hotkey via https://github.com/koekeishiya/skhd
# e.g. echo "ctrl + cmd - p : ~/lofi" >> ~/.skhdrc
notification() {
terminal-notifier -message 'Now Playing: Lofi Radio ☕️🎶'
@coolaj86
coolaj86 / rip-blu-rays-with-libredrive.md
Created July 12, 2021 21:27
Want to rip backups of your blu-rays? In short, get the LG WH16NS40 + Unitek ‎Y-1099NEW + WH16NS40-SVC50 v1.0.5 (via SDFTool) combo. It'll work.
title description date updated uuid categories permalink
How to Rip Blu-Rays with a LibreDrive
In short, get the LG WH16NS40 + Unitek Y-1099NEW + WH16NS40-SVC50 v1.0.5 (via SDFTool) combo. It'll work.
2021-06-29 5:33:34 pm
2021-07-09 10:33:00 am
4276bef0-c857-47b0-8c86-1e83701d89d9
Nerdom
/articles/how-to-rip-blurays-with-a-libredrive/
@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'
#!/bin/sh
/Applications/Discord.app/Contents/MacOS/Discord --proxy-server=http://po.cc.ibaraki-ct.ac.jp:3128