Skip to content

Instantly share code, notes, and snippets.

View neon-ninja's full-sized avatar
🔥
shader compilation intensifies

Nick Young neon-ninja

🔥
shader compilation intensifies
View GitHub Profile
@neon-ninja
neon-ninja / batch_download.py
Last active December 21, 2023 01:17
ESRI ImageServer downloader
#!/usr/bin/env python3
import os
from tqdm.auto import tqdm
from tqdm.contrib.concurrent import process_map, thread_map
import json
import requests
import time
url = "https://nrcsgeoservices.sc.egov.usda.gov/arcgis/rest/services/ortho_imagery/marshall_islands_vivid_2023_30cm/ImageServer"
@neon-ninja
neon-ninja / scrape-asa.ipynb
Created September 20, 2023 23:07
scrape ASA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@neon-ninja
neon-ninja / stonks.ipynb
Last active September 12, 2023 02:49
NZX50 close price prediction using RandomForestRegressor
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@neon-ninja
neon-ninja / index.html
Created March 24, 2023 03:28
MQTT debug view
<html>
<head>
<title>MQTT debug view</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
</head>
<body>
@neon-ninja
neon-ninja / get_consistent_extents.ipynb
Created January 5, 2022 03:11
Find the common extent among GeoTIFFs, clip them all to the common extent, reproject to common transform
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@neon-ninja
neon-ninja / 2075045235985932.json
Last active October 6, 2021 03:25
Sample facebook-scraper output with comments and reactions
{
"original_request_url": "2075045235985932",
"post_url": "https://facebook.com/story.php?story_fbid=2075045235985932&id=285708024919671",
"post_id": 2075045235985932,
"text": "Overnight at 1:00am AEDT, Super Smash Bros. Ultimate director Masahiro Sakurai will reveal the game's final fighter. The fighter's release date and final Mii Fighter costumes will also be revealed!\n\nWatch here: https://youtu.be/6sFVKXHkxP8",
"post_text": "Overnight at 1:00am AEDT, Super Smash Bros. Ultimate director Masahiro Sakurai will reveal the game's final fighter. The fighter's release date and final Mii Fighter costumes will also be revealed!\n\nWatch here: https://youtu.be/6sFVKXHkxP8",
"shared_text": "",
"time": "2021-10-05 21:22:08",
"timestamp": null,
"image": null,
@neon-ninja
neon-ninja / animated_lines.py
Created May 18, 2021 03:02
Python script to generate a gif animation of random lines
from matplotlib import pyplot as plt
from numpy.random import rand
from matplotlib.collections import LineCollection
from matplotlib import cm
import numpy as np
import imageio
from IPython.display import Image
ims = []
for frame in range(100):
@neon-ninja
neon-ninja / d3_circles.html
Created May 11, 2021 06:31
circle animation
<html>
<head>
<style>
html,
body,
svg {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
@neon-ninja
neon-ninja / P_idx_mat_replacement.py
Created April 10, 2021 02:02
replacing values in an 2D matrix containing irregular arrays, ints to floats
#!/usr/bin/env python3
import numpy as np
from scipy.io import loadmat, savemat
from tqdm.auto import tqdm
p_idx = loadmat("P_idx.mat",simplify_cells=True,mat_dtype=True)["P_idx"] # mat_dtype is necessary as we're replacing ints with floats
print(p_idx.shape)
replace = loadmat("Replacing_values.mat",simplify_cells=True)["network1"]
print(replace)
for pair in tqdm(replace):
FID = pair["FID_1"]