Skip to content

Instantly share code, notes, and snippets.

View remrama's full-sized avatar
🚶‍♂️
not finishing

Remington Mallett remrama

🚶‍♂️
not finishing
View GitHub Profile
@remrama
remrama / USAmap.tex
Created January 8, 2025 14:52 — forked from bordaigorl/USAmap.tex
USA TikZ map
%% Imported from https://upload.wikimedia.org/wikipedia/commons/3/32/Blank_US_Map.svg
%% Translated to TikZ using Inkscape 0.48
\tikzset{USA map/.cd,
state/.style={fill, draw=white, ultra thick},
HI/.style={}, AK/.style={}, FL/.style={}, NH/.style={}, MI/.style={}, MI/.style={}, VT/.style={}, ME/.style={}, RI/.style={}, NY/.style={}, PA/.style={}, NJ/.style={}, DE/.style={}, MD/.style={}, VA/.style={}, WV/.style={}, OH/.style={}, IN/.style={}, IL/.style={}, CT/.style={}, WI/.style={}, NC/.style={}, DC/.style={}, MA/.style={}, TN/.style={}, AR/.style={}, MO/.style={}, GA/.style={}, SC/.style={}, KY/.style={}, AL/.style={}, LA/.style={}, MS/.style={}, IA/.style={}, MN/.style={}, OK/.style={}, TX/.style={}, NM/.style={}, KS/.style={}, NE/.style={}, SD/.style={}, ND/.style={}, WY/.style={}, MT/.style={}, CO/.style={}, ID/.style={}, UT/.style={}, AZ/.style={}, NV/.style={}, OR/.style={}, WA/.style={}, CA/.style={}}
\tikzset{
every state/.style={USA map/state/.style={#1}},
HI/.style={USA map/HI/.style={#1}}, AK/.
@remrama
remrama / dramatic_arc_figure.py
Created February 13, 2024 01:07
A visualization of the "dramatic arc" and three sub-components measured with LIWC.
"""Plot for a grant.
Plot the dramatic arc on the left axis
and 3 components (staging, progression, tension) on the right axis.
Arrows connect them.
"""
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
from scipy.interpolate import CubicSpline
@remrama
remrama / fdd-clean_reports.py
Last active December 5, 2023 19:27
Flying Dream Database cleaning
"""
Clean some text in the FDD reports.
This takes the database from version 0.1.2 to 0.2.0.
"""
import re
import pandas as pd
@remrama
remrama / paper-qa-zotero.py
Created May 21, 2023 17:03 — forked from lifan0127/paper-qa-zotero.py
Streamlining Literature Reviews with Paper QA and Zotero
import os
os.environ['OPENAI_API_KEY'] = '<Your OpenAI API Key>'
# See here on how to find your Zotero info: https://github.com/urschrei/pyzotero#quickstart
ZOTERO_USER_ID = '<Your Zotero User ID>'
ZOTERO_API_KEY = '<Your Zotero API Key>'
ZOTERO_COLLECTION_ID = '<Your Zotero Collection ID>'
question = 'What predictive models are used in materials discovery?'
# The following prompt instruction is injected to limit the number of keywords per query
@remrama
remrama / dmedia.py
Last active December 27, 2023 04:27
Scrape Reddit posts using pmaw to access pushshift.
"""
Download all media (from media posts) into a single zip file.
Does not catch gallery or multi-image posts.
> python rscrape.py --subreddit MedievalArtMemes
> python dmedia.py --subreddit MedievalArtMemes
"""
import argparse
import json
import logging
@remrama
remrama / explore.py
Created February 12, 2023 22:50
spatial task analysis
"""
Each participant has:
- sub-001
- theta (counterbalanced Stimulus Set A or B)
- Learning (useable??) (in-lab/.../tv5-01_Theta_Initial learning_2022_Sep_01_1033.csv)
- Pre-test (in-lab/.../tv5-01_setA-memorytest1_2022_Sep_01_1109.csv)
- Post-test (in-lab/.../tv5-01_memoryTest2_2022_Sep_01_1224.csv)
- Reactivation?? (in-lab/.../tv5-01_reactivation_2022_Sep_01_1147.csv)
- Condition 1 [no reactivation]
- Condition 2 [reactivation no stim]
silentpath="2secblank.wav"
for puzzlepath in Puzzlenames/*.wav; do
puzzlebase="${puzzlepath##*/}"
puzzlename="${puzzlebase%.wav}"
for soundpath in Soundfiles/*.wav; do
soundbase="${soundpath##*/}"
soundname="${soundbase%.wav}"
export_path="Merged/${puzzlename}-${soundname}.wav"
# printf "file '${puzzlepath}'\nfile '${silentpath}'\nfile '${soundpath}'" > list.txt
import schemdraw
from schemdraw import flow
import schemdraw.elements as elm
"""
d1
"""
with schemdraw.Drawing(show=True) as d:
# with schemdraw.Drawing(file="mycrc.svg") as d:
d.config(fontsize=10)
d += (b := flow.Start().label("Lucid dream\ninduction attempt"))
@remrama
remrama / scrape-reddit.py
Created September 17, 2021 18:11
simplest use of psaw/pushshift to scrape reddit, no restrictions on time
"""scrape ALL the SUBMISSIONS of a given subreddit
"""
import os
import json
import tqdm
import datetime
import argparse
from psaw import PushshiftAPI
"""
separate dream and nondream content
create two new columns
one with bracketed one without
"""
import os
import re
import argparse
import pandas as pd