Skip to content

Instantly share code, notes, and snippets.

View nickymarino's full-sized avatar
💻
probably typing somewhere

Nicky Marino nickymarino

💻
probably typing somewhere
View GitHub Profile
@nickymarino
nickymarino / add_to_reader.py
Last active June 16, 2023 02:52
Bulk add items to Reader via API
from typing import List, Optional
import requests
import pydantic
import json
import time
URL = "https://readwise.io/api/v3/save/"
TOKEN = "xxxxxxxx"
links = [
@nickymarino
nickymarino / keybase.md
Created October 3, 2020 19:51
Keybase Verification

Keybase proof

I hereby claim:

  • I am nickymarino on github.
  • I am nickymarino (https://keybase.io/nickymarino) on keybase.
  • I have a public key ASA4K42AwN-llpIOxlaflVtpazeEOO7u5Y6t2WphMUVnxgo

To claim this, I am signing this object:

# Python 3.6
# https://reddit.com/r/ProgrammerHumor/comments/cv6da5/_/ey28dm9/?context=1
(lambda _, __, ___, ____, _____, ______, _______, ________:
getattr(
__import__(True.__class__.__name__[_] + [].__class__.__name__[__]),
().__class__.__eq__.__class__.__name__[:__] +
().__iter__().__class__.__name__[_:][_____:________]
)(
_, (lambda _, __, ___: _(_, __, ___))(
lambda _, __, ___:
import cv2 # opencv.org
import numpy as np
def get_frame_averages(video_path):
vc = cv2.VideoCapture(video)
if vc.isOpened():
rval, frame = vc.read()
else:
@nickymarino
nickymarino / helpers.py
Created June 21, 2018 16:34
Python helper functions that I don't want to rewrite
def replace_str_index(text, index=0, replacement=''):
'''Replaces an index in a string with a replacement char/string'''
return '{}{}{}'.format(text[:index], replacement, text[index+1:])
def get_substrings(string):
'''Returns a list of all substrings in a string'''
length = len(string)
return [string[i:j+1] for i in range(length) for j in range(i, length)]
def copy_to_clipboard(string):
@nickymarino
nickymarino / clipboard.py
Created June 21, 2018 15:00
Copy to clipboard using python
import sys
import subprocess
def copy(string):
commands = {'win32': 'clip',
'cygwin': 'clip',
'darwin': 'pbcopy',
}
currentPlatform = sys.platform
@nickymarino
nickymarino / small_latex.tex
Created September 5, 2017 19:49
Minimal Latex structure
\documentclass{article}
% General document formatting
\usepackage[margin=0.7in]{geometry}
\usepackage[parfill]{parskip}
\usepackage[utf8]{inputenc}
\begin{document}
\end{document}