var elements = document.querySelectorAll("[aria-label^='Dismiss']");
elements.forEach(element => {
element.click();
});
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Script for plotting animated moving averages of stock prices. | |
Examples: | |
python3 spy_30y.py --show | |
""" | |
import logging | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./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()." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mp3splt -q -t 10.0 -o "@n @f" The\ first\ 20\ hours\ --\ how\ to\ learn\ anything\ \|\ Josh\ Kaufman\ \|\ TEDxCSU_5MgBikgcWnY.mp3 |
NewerOlder