Skip to content

Instantly share code, notes, and snippets.

View darachm's full-sized avatar
💭
Login to set your status

darachm

💭
Login to set your status
View GitHub Profile
@darachm
darachm / gist:a17a7a96ea3da992380d8528055b5c64
Created July 10, 2018 00:02
python3 script to yank down emails from gmail with imap
# modified from this: https://gist.github.com/baali/2633554/
# Same logic, etc, just modified for python3
# Could use argument parser, but really how many times are you going to use this?
#
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
import getpass
import imaplib
import os
@darachm
darachm / mask2pants
Last active June 5, 2021 06:44
save as bookmark(let), where this is the location, then click on a webpage to turn many of masks into pants
javascript:document.querySelectorAll('p, span, li, h1, h2, h3, h4, h5, h6')
.forEach(function(x){
if(x.innerText){
x.innerText=x.innerText.replace(/A mask is/g,'Pants are');
x.innerText=x.innerText.replace(/mask is/g,'pants are');
x.innerText=x.innerText.replace(/a mask/g,'pants');
x.innerText=x.innerText.replace(/masks/g,'pants');
x.innerText=x.innerText.replace(/mask/g,'pants');
x.innerText=x.innerText.replace(/Masks/g,'Pants');
x.innerText=x.innerText.replace(/Mask/g,'Pants');
javascript: var cell = Jupyter.notebook.get_selected_cell();
var config = cell.config;
var patch = {
CodeCell:{
cm_config:{autoCloseBrackets:{pairs: ""}}
}
};
config.update(patch);
@darachm
darachm / archive_tweets.R
Last active November 18, 2022 23:01 — forked from joelnitta/archive_tweets.R
Archive a user's tweets - now plus following/followers
library(rtweet)
library(tidyverse)
# Initial authorization setup, only need to do once
# auth_setup_default() #nolint
# Authorize
auth_as("default")
# Set user name