This file contains hidden or 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
from itertools import groupby | |
def break_into(it, count): | |
def keyfunc(elem): | |
keyfunc.counter += 1 | |
return (keyfunc.counter-1)//count | |
keyfunc.counter = 0 | |
return (g for k, g in groupby(it, keyfunc)) |
This file contains hidden or 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
# obtains external IP address | |
alias whatismyip="curl -s ipecho.net/plain | xargs -0 echo" | |
# linux xorg copy/paste implementation - mirroring the macos commands | |
alias pbcopy='xclip -selection clipboard' | |
alias pbpaste='xclip -selection clipboard -o' | |
# pipe the destination machines clipboard to local clipboard | |
alias osxnetwork-paste='ssh OSX_MACHINENAME.local pbpaste | pbcopy' |
This file contains hidden or 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
# | |
# IMPORTANT NOTE: | |
# | |
# THIS FILE IS MAYBE JUST ONE OF MANY CONFIGURATION FILES IN THIS DIRECTORY. | |
# SETTINGS MADE IN OTHER FILES CAN OVERRIDE VALUES THAT YOU CHANGE HERE. GO | |
# LOOK FOR OTHER CONFIGURATION FILES! CHECK THE MANUAL AND INSTALLATION NOTES | |
# (like README.Debian) FOR MORE DETAILS! | |
# | |
# This is a configuration file for apt-cacher-ng, a smart caching proxy for |
This file contains hidden or 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 tmdbsimple as tmdb | |
import csv | |
tmdb.API_KEY = 'YOUR API KEY HERE' | |
list_id = ID OF THE LIST | |
movies = tmdb.Lists(list_id).info()['items'] | |
movie_ids = [mov['id'] for mov in movies] | |
with open(f"tmdb_{list_id}.csv", "w") as f: |
This file contains hidden or 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
openapi: 3.0.1 | |
info: | |
title: Shortcut API | |
description: Shortcut API | |
version: "3.0" | |
servers: | |
- url: https://api.app.shortcut.com/ | |
security: | |
- api_token: [] | |
paths: |
This file contains hidden or 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 hashlib | |
def read_wordnet_line(filename, line_number): | |
"""Reads a specific line from a file, wrapping around if necessary.""" | |
try: | |
with open(filename, 'r') as f: | |
lines = f.readlines() | |
num_lines = len(lines) | |
if num_lines == 0: | |
return None # Handle empty file case |