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 spotipy | |
from spotipy.oauth2 import SpotifyClientCredentials, SpotifyOAuth | |
from os import environ | |
from pprint import pprint | |
from notion_client import Client | |
notion = Client(auth=environ["NOTION_TOKEN"]) | |
spotify = spotipy.Spotify( | |
client_credentials_manager=SpotifyClientCredentials(), | |
auth_manager=SpotifyOAuth( |
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
# Updated from https://gist.github.com/pkazmier to support yabai | |
# | |
# The following configuration heavily leverages modal keymaps to minimize the | |
# pollution of global keybindings. In addition, the modal keymaps facilitate | |
# the consistent use of the same keybindings across different modes. For | |
# example, this configuration uses 'h', 'l', 'j', and 'k' to represent west, | |
# east, south, and north when: changing focus, warping windows, resizing | |
# windows, swapping windows, and moving floating windows. Those four keys are | |
# mapped differently depending on the current mode to provide a consistent user | |
# experience. |
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
from bs4 import BeautifulSoup | |
soup = BeautifulSoup("https://github.com") | |
table = soup.table | |
result_dict = { | |
header.text: { | |
row.find_all("td")[0].text: row.find_all("td")[index].text | |
for row in table.tbody.find_all("tr") | |
} |
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
#!/bin/bash | |
rint=$(($RANDOM % 2608)) && curl -s "https://www.gstatic.com/prettyearth/assets/full/"$(curl -s https://earthview.withgoogle.com/_api/photos.json | jq --arg i $rint '.[$i | tonumber].slug' | sed 's/[^0-9]*//g')".jpg" -o earthview.jpg --output-dir $TMPDIR && osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \""$TMPDIR"earthview.jpg\"" && killall Dock |
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 math | |
p = [] | |
s_num = 0 | |
not_visited = [] | |
class Star: | |
def __init__(self, pos): | |
self.x, self.y = pos[0], pos[1] | |
self.neighbors = [] |
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
from collections import namedtuple | |
from math import floor | |
Coords = namedtuple("Coords", "x y") | |
Mirror = namedtuple("Mirror", "coords direction") | |
lightx, lighty, intensity, plantmax = [int(num) for num in input().split(" ")] | |
plant = range(plantmax + 1) | |
light = Coords(lightx, lighty) | |
mirrors = [] |
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 You(param) { | |
if (param == 1) { | |
height = 30.48*document.running.heightf.value + 2.54*document.running.heighti.value | |
document.running.heightm.value = height | |
shoulder = 2.54*document.running.shoulderi.value | |
document.running.shoulderm.value = shoulder | |
chest = 2.54*document.running.chesti.value | |
document.running.chestm.value = chest | |
} | |
if (param == 2) { |