Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Doiron mapmeld

View GitHub Profile
@mapmeld
mapmeld / investments.md
Last active Jan 7, 2021
Stock and ETF which I invested in
View investments.md

Not including how many shares I have or what % of my investments these are

Not including cryptocurrencies

Ticker Info Effective Avg Purchase Price
VTHRX Vanguard retirement ?
VDC Vanguard consumer staples 172.75
XCEM Em econ not China 29.87
HOMZ Housing 32.26
@mapmeld
mapmeld / bb.md
Last active Jan 4, 2021
Bangla Benchmark runs
View bb.md

Code: https://colab.research.google.com/drive/1vltPI81atzRvlALv4eCvEB0KdFoEaCOb?usp=sharing

Can these scores be improved? YES!

Rerunning with more training data, more epochs of training, or using other libraries to set a learning rate / other hyperparameters before training.

  • Experimenting with epochs - when I doubled the number of epochs, MuRIL improves only slightly (69.5->69.7 on one task)

The point of a benchmark is to run these models through a reasonable and identical process; you can tweak hyperparameters on any model to improve results.

@mapmeld
mapmeld / twiml-lightning-share.md
Last active Oct 22, 2020
twiml-lightning-share
View twiml-lightning-share.md
@mapmeld
mapmeld / OverEncrypt.md
Last active Sep 27, 2020
OverEncrypt - paranoid HTTPS
View OverEncrypt.md

OverEncrypt

This is a guide that I wrote to improve the default security of my website https://fortran.io , which has a certificate from LetsEncrypt. I'm choosing to improve HTTPS security and transparency without consideration for legacy browser support.

WARNING: if you mess up settings, lose your certificates, or decide to no longer maintain HTTPS certs, these steps can and will make your domain inaccessible.

I would recommend these steps only if you have a specific need for information security, privacy, and trust with your users, and/or maintain a separate secure.example.com domain which won't mess up your main site. If you've been thinking about hosting a site on Tor, then this might be a good option, too.

The best resources that I've found for explaining these steps are https://https.cio.gov , https://certificate-transparency.org , and https://twitter.com/konklone

@mapmeld
mapmeld / dv-wave.py
Last active Jul 16, 2020
PythonCode
View dv-wave.py
from simpletransformers.classification import ClassificationModel
# set use_cuda=False on CPU-only platforms
model = ClassificationModel('bert', 'monsoon-nlp/dv-wave', num_labels=8, use_cuda=True, args={
'reprocess_input_data': True,
'use_cached_eval_features': False,
'overwrite_output_dir': True,
'num_train_epochs': 3,
'silent': True
})
@mapmeld
mapmeld / load_acs.py
Last active Jul 8, 2020
Load 5-year ACS race + ethnicity data, ending in 2017
View load_acs.py
# pip install requests
import time, json
import requests
api_key = "API_KEY_STRING"
# look up FIPS for state and county:
# https://www.nrcs.usda.gov/wps/portal/nrcs/detail/national/home/?cid=nrcs143_013697
state = '12'
county_fips = ['086']
@mapmeld
mapmeld / add_to_shapefile.py
Created Jul 5, 2020
Add JSON block data to a shapefile with GDAL
View add_to_shapefile.py
# pip install gdal
import json
from osgeo import ogr
# depends on your shapefile
target_shapefile = 'tl_2010_sample_shapefile.shp'
fips_id = 'GEOID10'
saveblocks = json.loads(open('savefile.json', 'r').read())
@mapmeld
mapmeld / links.md
Last active May 13, 2020
References and links for Spanish counterfactuals
View links.md
@mapmeld
mapmeld / split-multi.py
Created Dec 29, 2015
Split a GeoJSON MultiPolygon FeatureCollection into GeoJSON Polygons
View split-multi.py
# split-multi.py
# open source, MIT license
import json
js = open('multipolygon.geojson', 'r').read()
gj = json.loads(js)
output = { "type": "FeatureCollection", "features": [] }
View AutoKeras_image_regression.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.