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 matplotlib.pyplot as plt | |
| from matplotlib.patches import Rectangle | |
| import geopandas as gpd | |
| import fiona | |
| import numpy as np | |
| fiona.drvsupport.supported_drivers["KML"] = "rw" | |
| title = "Title" | |
| override_bucket0_color = "lightgrey" # set to None to use colormap color |
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 matplotlib.pyplot as plt | |
| from matplotlib.patches import Rectangle | |
| import geopandas as gpd | |
| import fiona | |
| fiona.drvsupport.supported_drivers["KML"] = "rw" | |
| # Load detailed US states data from the U.S. Census Bureau | |
| # Source: https://www2.census.gov/geo/tiger/GENZ2022/shp/cb_2022_us_state_20m.zip | |
| states = gpd.read_file( |
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 numpy as np | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| from typing import List | |
| def is_year(s: str): | |
| try: | |
| value = int(s) | |
| return value >= 1960 |
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
| #!/usr/bin/env python3 | |
| import os | |
| import time | |
| MUSIC_DIR="/data/Music/" | |
| COVERS_DIR="/data/Covers/" | |
| COVER_VIDEO_FILE="covers.mp4" | |
| OUTPUT_VIDEO_FILE="output.mp4" | |
| WARNING_IMAGE_FILE="warning.jpg" | |
| WARNING_VIDEO_FILE="warning.mp4" |
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
| #!/bin/bash | |
| LIVING_ROOM_IP=192.168.0.186 | |
| BASEMENT_GYM_IP=192.168.0.159 | |
| # $1 = Kodi server IP address | |
| rsync_music_videos_kodi () { | |
| rsync -ahPv /data/MusicVideos/ root@$1:/storage/musicvideos/ \ | |
| --delete --prune-empty-dirs | |
| } |
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
| #!/bin/bash | |
| # Nuke Wisconsin - Music Video Generator Example | |
| VIDURL="https://www.youtube.com/watch?v=Pq6yMDBOcuI" | |
| youtube-dl -k -f 'bestvideo[fps<=30]+bestaudio' $VIDURL | |
| INVID="Chinese Nuclear Testing Film (1966)-Pq6yMDBOcuI.f135.mp4" | |
| INAUD="The Crucifucks - The Savior.mp3" | |
| STARTTIME="00:10:00" | |
| OUTVID="1987 - Crucifucks - The Savior.mp4" | |
| ffmpeg -ss "$STARTTIME" -i "$INVID" -i "$INAUD" -shortest -y "$OUTVID" |
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 pandas as pd | |
| office = 'DEMCNG0007UNITED STATES REPRESENTATIVE' | |
| csv_filename = '2006PrimaryElectionResults.csv' | |
| # Data source: | |
| # https://data.indy.gov/search?q=elections%20results%20 | |
| # specifically: | |
| # https://xmaps.indy.gov/ODP/Download/Elections/2006PrimaryElectionResults.xls (needs to be converted to to CSV) |
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
| digraph D { | |
| edge [arrowhead=normal, color=black] | |
| Ideology -> {Other, Left, Right} | |
| Other -> {AnarchoPrimitivism} | |
| Left -> {Anarchism, Socialism, Liberalism} | |
| Liberalism -> {SocialDemocracy} | |
| Right -> {Neoliberalism, Libertarianism, Conservatism, Monarchism, Fascism} | |
| Fascism -> NazBols | |
| Libertarianism -> AnarchoCapitalism | |
| edge [arrowhead=onormal, color=orange] |
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 json | |
| data = {'x': [1,2,3], 'y': 4, 'z': 5} | |
| json_str = json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')) | |
| print(json_str) |