Skip to content

Instantly share code, notes, and snippets.

View cs01's full-sized avatar

Chad Smith cs01

View GitHub Profile
@JamieMason
JamieMason / unfollow.js.md
Last active July 13, 2024 16:36
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
@techtonik
techtonik / NonBlockingPipe.md
Last active September 21, 2023 18:01
Non-blocking pipe reads in Windows Python
@mborgerson
mborgerson / mesa-offscreen-sw-demo.md
Last active March 9, 2022 17:18
Mesa Offscreen Software Rendering

Build Mesa Off-Screen Software Renderer

Last tested on October 6th, 2020, using a fresh Ubuntu 20.04 Docker image. Works with latest version of mesa (20.2.0), at time of writing.

# Install build dependencies
apt update
apt install build-essential git python3 python3-setuptools python3-mako bison flex meson pkg-config wget
# This script is sourced from all over the place to fix broken shells.
# It does assume you have at *least* /usr/bin:/bin though.
# Significant care is taken to be sh-compatible; if bash or zsh could be
# required, it could be made simpler or more generic.
has_PATH () {
local tmp=":$PATH:"
[ "${tmp}" != "${tmp#*:$1:}" ]
}
@jessesquires
jessesquires / gitsl.sh
Last active December 3, 2023 07:08
git "smartlog" / "pretty log"
# blog post
#
# https://www.jessesquires.com/blog/customizing-git-log/
git log --graph --pretty=format:'commit: %C(bold red)%h%Creset %C(red)<%H>%Creset %C(bold magenta)%d %Creset%ndate: %C(bold yellow)%cd %Creset%C(yellow)%cr%Creset%nauthor: %C(bold blue)%an%Creset %C(blue)<%ae>%Creset%n%C(cyan)%s%n%Creset'
@johnhw
johnhw / umap_sparse.py
Last active January 6, 2024 16:09
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active July 20, 2024 14:26
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
// This is a hack, a quick and dirty console script for RT/tweets (with replies) removal w/o API
// To be used in: https://twitter.com/Username/with_replies
// Set your username (without @) below (case-sensitive) to correctly trigger the right Menu
const tweetUser = 'Username'
// BUG, With above we still trigger Menu on some replies but relatively harmless.
// @Hack Implement simple has() for querySelector
const querySelectorHas = function( parent, child ){
@fersandiP
fersandiP / script.js
Last active July 8, 2021 04:47
Script to delete tweets automatically from your browser
// Open your tweet pages (Tweets, Tweets & replies, or Media)
// Execute this script in the console
// Tested on Chrome Version 91.0.4472.114 (Official Build) (x86_64) MacOS
// If the script stopped, refresh the page and execute it again
var tweets = document.querySelectorAll('[data-testid="tweet"]');
while (tweets.length > 0) {
tweets.forEach(function(tweet){