Skip to content

Instantly share code, notes, and snippets.

View ercas's full-sized avatar
💭
how does this status thing work

Edgar Castro ercas

💭
how does this status thing work
  • Harvard T.H. Chan School of Public Health
View GitHub Profile
# Reproduction ov https://twitter.com/TransAlt/status/1547237573726191620 for
# Boston, using Census data + Boston GIS vectors
library(dplyr)
library(ggplot2)
library(units)
library(sf)
library(tidycensus)
census_api_key(API KEY HERE)
@ercas
ercas / main.py
Created February 14, 2021 23:52
space email scraper
import bs4
import dateutil.parser
import peewee
import requests
import tqdm
POST_PAGE = "https://space.galaxybuster.net/lib/view.php"
LAST_ID = 333377
db = peewee.SqliteDatabase("space-email.db")
@ercas
ercas / listenbrainz.R
Last active July 21, 2021 15:58
create graphs of listenbrainz data
library(dplyr)
library(ggplot2)
library(jsonlite)
library(lubridate)
library(stringr)
# load data ---------------------------------------------------------------
data <- fromJSON("ercas_lb-2021-07-21.json") %>%
flatten() %>%
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDTJCWH8BRFTGvKpQwuLd0PSPew20NiUj4+d0VuEXt/e9WD7bhifTt6aPKkKxv+98gkjnR1Z5O/E2GGfBb019+ycEWiTDFTsV8ci6QoPBUkABBjlREJMNS59FyReY2/vaVGDiRuE0pP3PiUIKPkRh04AwReEYa8xfgO4D8S15ZIMhW2jHJB98zeowYaTdnmYS9rv/ygcLs1fU6KDy6bWMK6aWBVQapdea9Ct2sYWzJEHrkt+Z1o+C0DFJl5bvbUEBxZbe91m3O0qOesjY+QHTNQQSIDAEY+y9cdMKz3DvtPtBZoEACtYQv65YNptxrYE0+Gooo2HA8jvMxJXum4Wl2GQvyH2V+WEYEGfRVm6IWcXNtmBd164mIXOHD7MS5xK2ko4RRHHpCGF3whz6XDn+HQi+c/I4FGcDUzF1FHosBWhDQv8uvPdutdbaJQsGAIwZE697QQwzfhIY+AIUyW+/OhOB1KhvSMLF61QR+o/XKLE558EZ0cRVvXpVyrw0G3cv6cLNUD+Z3Wyody76or1/5kJAY0CB4iUKDApN4JNi13FbyTiXFC7VnlDH83IQbaj+78gzrzQ4jviJ8Y/pQk+a2MHFAWW/tGVT0bvbmnDGJCaun8DvhvlCZnd/C7QAJcfeVz+7XHSpzkH7xaOD/mVf6Fq6/+trPIlzgS0OmuAqclaw== leaf@juniper
#!/usr/bin/env python3
""" Command-line tool to automatically start an interactive Python session and
run some initial importing code. All code between the lines starting with the
comments `# BEGIN SETUP` and `# END SETUP` will be echoed back to the user with
the indentation level of the `# BEGIN SETUP` line removed.
"""
import os
PYTHON_BIN="ipython3"
// Compile with: g++ ./cuebiq-subset.cpp -std=c++11 -Wall -O3 -funroll-loops -o cuebiq-subset
#include <algorithm>
#include <fstream>
#include <iostream>
#include <string>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
/* reimplementation of simpsons-bruteforce.lua in c for practice */
#include <stdio.h>
#define INCREMENT 5
#define a_part 210
#define a_whole 300
#define b_part 180
#define b_whole 300