Skip to content

Instantly share code, notes, and snippets.

View namuan's full-sized avatar
🎯
Focusing

namuan namuan

🎯
Focusing
View GitHub Profile
@namuan
namuan / script.js
Created February 16, 2024 07:51 — forked from luighifeodrippe/script.js
Download a JSON List of twitter bookmarks
/* Enhancements to the Twitter Scraping Script:
This update to the script introduces a more robust mechanism for extracting detailed interaction data from tweets as they are scraped from Twitter. Previously, the script focused on collecting basic content such as the tweet's text. Now, it has been augmented to include a comprehensive extraction of interaction metrics, including replies, reposts, likes, bookmarks, and views, for each tweet.
Key Changes:
1. Improved Data Extraction:
- The script now searches through all elements within a tweet that have an `aria-label` attribute, filtering for labels that contain key interaction terms (replies, reposts, likes, bookmarks, views). This ensures that only relevant `aria-labels` are considered for data extraction.
2. Flexible Interaction Data Parsing:
@namuan
namuan / twitter-no-interests-topics.md
Last active August 11, 2024 13:39
Remove all interests and topics on Twitter

Screenshot 2023-05-21 at 11 34 40@2x

var elements = document.querySelectorAll("[aria-label^='Dismiss']");

elements.forEach(element => {
  element.click();
});
@namuan
namuan / interest-rate.py
Created May 10, 2023 18:59
Plot interest rate data from Bank of England
import re
import datetime
import matplotlib.pyplot as plt
def parse_data_string(data_string):
pattern = r"(\d{1,2})\s([a-zA-Z]{3})\s(\d{2})\s(\d+\.\d+)"
match = re.match(pattern, data_string)
if match:
// ==UserScript==
// @name Hide Links From Mainstream Media
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hides all links from mainstream media websites on news.ycombinator
// @match https://news.ycombinator.com/*
// @grant none
// ==/UserScript==
(function() {
@namuan
namuan / pyqt5_pyqt6.sh
Created March 12, 2023 18:27
PyQt5 -> PyQt6
./venv/bin/pyuic5 -> ./venv/bin/pyuic6
search_replace "PyQt5==5.12.3" "PyQt6==6.4.2"
search_replace "\.exec_ " ".exec"
search_replace "QStandardPaths.DocumentsLocation" "QStandardPaths.StandardLocation.DocumentsLocation"
search_replace "qApp." "QApplication.instance()."
function git_delete_missing_remote_branches() {
bold=$(tput bold)
normal=$(tput sgr0)
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do echo -n "Delete this branch ${bold}$branch${normal}? [y/n] " && read should_delete && (test "$should_delete" = 'y' && git branch -D $branch || echo "Ignoring branch $branch"); done
}
echo "Installing xcode-stuff"
xcode-select --install
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
digraph architecture {
rankdir=LR;
// Storage - #303F9F (dark blue)
node[fillcolor="#303F9F" style="filled" fontcolor="white"];
database[label="DB"]; cache[label="Redis"];
// Client-side Apps - #FFEB3B (yellow)
node[fillcolor="#FFEB3B" style="filled" fontcolor="black"];
front_end[label="Front-end App"]; extension[label="Browser Extension"];
@namuan
namuan / m3split
Last active July 12, 2020 13:11
Split mp3 file into smaller chunks
mp3splt -q -t 10.0 -o "@n @f" The\ first\ 20\ hours\ --\ how\ to\ learn\ anything\ \|\ Josh\ Kaufman\ \|\ TEDxCSU_5MgBikgcWnY.mp3
@namuan
namuan / floating_button_widget.py
Created January 2, 2020 10:25
PyQt5 Floating button on top of QPlainTextEdit
import sys
from PyQt5 import QtCore
from PyQt5 import QtWidgets
class FloatingButtonWidget(QtWidgets.QPushButton):
def __init__(self, parent):
super().__init__(parent)