Skip to content

Instantly share code, notes, and snippets.

@ravening
ravening / dividend_ex_date.py
Created April 22, 2021 15:40
get ex dividend date
import pandas, requests, datetime, calendar
class dividend_calendar:
#class attributes
calendars = []
url = 'https://api.nasdaq.com/api/calendar/dividends'
hdrs = {'Accept': 'application/json, text/plain, */*',
'DNT': "1",
'Origin': 'https://www.nasdaq.com/',
'Sec-Fetch-Mode': 'cors',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0)'}
@rachelmyers
rachelmyers / Chromebook_setup.md
Last active October 19, 2024 04:52
How I set up my Chromebooks' dev environment

Chromebook Setup Options

Option 1: Stay in Chrome OS

If you're writing bare-bones javascript for the browser, creating Chrome Apps and Extensions, or using remote coding apps like cloud9, Koding, or Nitrous, you may not need to install Ubuntu. Some tutorials can be done entirely within the browser. The tradeoff is that you won't have a full-featured command line, and you may hit a point where you can't install something that you need.

To start coding within Chrome OS, install Text or Caret as a text editor. (Text stores files in Google Docs and Caret stores the files locally on your machine, which may help you choose.) After that, you're good to go, since Chromebooks come with a browser installed.

Optio

@johnbaums
johnbaums / polygonizer.R
Last active February 15, 2021 02:18
Convert raster data to a ESRI polygon shapefile and (optionally) a SpatialPolygonsDataFrame
polygonizer <- function(x, outshape=NULL, pypath=NULL, readpoly=TRUE,
fillholes=FALSE, aggregate=FALSE,
quietish=TRUE) {
# x: an R Raster layer, or the file path to a raster file recognised by GDAL
# outshape: the path to the output shapefile (if NULL, a temporary file will
# be created)
# pypath: the path to gdal_polygonize.py or OSGeo4W.bat (if NULL, the function
# will attempt to determine the location)
# readpoly: should the polygon shapefile be read back into R, and returned by
# this function? (logical)