Skip to content

Instantly share code, notes, and snippets.

@melanieimfeld
melanieimfeld / secondop.js
Last active May 4, 2021 16:58
Second opinion bookmarklet
//copied from https://www.thetechbasket.com/most-useful-bookmarklets/#Second-Opinion-Search
javascript: Q = [];
c = location.search.slice(1).split('&');
for (i in c) {
f = c[i].split('=');
if (f[0] == 'q' || f[0] == 'as_q' || f[0] == 'p' || f[0] == 'query')
if (f[1]) Q.push(f[1])
}
R = unescape(Q.join('; ').replace(/\+/g, ' '));
@melanieimfeld
melanieimfeld / getdata.py
Last active September 17, 2020 16:45
Floodplain analysis NYC Geopandas
import geopandas as gpd
import pandas as pd
from shapely.geometry import Polygon, shape
from sodapy import Socrata
import os
#Run this file to get the data from open data NYC
#Below are the details, such as identifiers, for the datasets we want to download. Change limit to get a smaller subset
@melanieimfeld
melanieimfeld / README.md
Last active March 9, 2023 18:05
Space Invaders

Unfriendly 🛸

Written in JavaScript using the HTML canvas and the requestAnimationFrame method. Works best in Chrome or Firefox.

Game Elements & Functionalities

  • Gamecanvas: Can be started and stopped with space bar
  • Player: Can move left or right with < > keys
  • Opponent Ufos: 9 Colums x 4 Rows of opponents that bounce back and forth horizontally and move down vertically. If opponents collide with player, the game is over. It can be restarted with a window refresh.

File Structure

  • index.html: HTML template
@melanieimfeld
melanieimfeld / cityshapes.py
Last active April 27, 2022 23:15
Ordering Cities using Python
import argparse
import requests
import json
import geopandas as gpd
import pandas as pd
from shapely import affinity
from shapely.geometry import Polygon, Point, MultiPolygon
from matplotlib import pyplot as plt
import numpy as np
from osmtogeojson import osmtogeojson