Skip to content

Instantly share code, notes, and snippets.

View stringertheory's full-sized avatar

Mike Stringer stringertheory

View GitHub Profile
@dfreelon
dfreelon / top_BMMC_tracks_public.py
Created July 1, 2023 14:02
The code I used to create the #BlackMusicMonthChallenge top tracks playlists for Spotify and YouTube. The code requires valid Spotify and YouTube API credentials.
# -*- coding: utf-8 -*-
# run the following two snscrape commands from a CLI first -- you'll need the dev version from https://github.com/JustAnotherArchivist/snscrape
# future replicators: I recommend using Twitter's "since" and "until" date operators. I used snscrape's built in "since" operator because I ran it on June 30 so didn't need "until"
#for replies: snscrape --since 2023-05-31 --jsonl twitter-search @naima >@naima_replies_all.json
#for QTs: snscrape --since 2023-05-31 --jsonl twitter-search quoted_user_id:78417631 >@naima_qts_all.json
import html
import json
import pandas as pd
@rmtbb
rmtbb / ChatGPT Canvas HTML Renderer from Clipboard.url
Last active April 24, 2025 10:07
Bookmarklet that lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(t){if(t){var e=window.open("","_blank","width=800,height=600");e.document.open(),e.document.write(t),e.document.close()}else alert("Clipboard is empty. Please copy some text to the clipboard first.")}).catch(function(t){console.error("Failed to read clipboard contents: ",t),alert("An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.")})}catch(t){console.error("An error occurred:",t),alert("An error occurred while trying to open the new window with the clipboard content.")}})();//bookmarklet_title: HTML Preview from Clipboard
@LoueeD
LoueeD / bsky-comments.js
Last active January 24, 2025 04:10
bluesky comments web component - inspired by emilyliu and coryzue
// Moved to a github repo for versioning, the file can now be loaded from a CDN
// <script type="module" src="https://esm.sh/gh/loueed/[email protected]/comments"></script>
class BskyComments extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
this.visibleCount = 3;
this.thread = null;
this.error = null;