Skip to content

Instantly share code, notes, and snippets.

View jsoma's full-sized avatar

Jonathan Soma jsoma

View GitHub Profile
@jsoma
jsoma / README.md
Created September 23, 2019 20:05
How to set up a project for eslint and prettier to catch bugs and be beautiful

Using eslint and prettier to make your code perfect and beautiful and help you catch bugs while you're writing it

Setting up a node project

This doesn't work that well if we don't set up a node project first.

First, open up the homework folder in your text editor, not just the files individually. This is just because it makes life a lot easier, not necessarily because you need to (although... maybe you do?)

On the command line, cd into the folder that your work is in. Or try using View > Terminal from the upper menu to make a terminal open up in VSCode.

@jsoma
jsoma / README.md
Last active October 10, 2019 14:33
Using d3-tip and d3-annotation when you aren't just using a script tag

Since we live in a future that involves cool modern JavaScript and build systems like webpack and Parcel, you might sometimes have a little trouble installing or using JavaScript or D3 libraries. Let's take a look at two, and how we adapt them for our code (specifically with sawhorse).

d3-tip

d3-tip has been around since the earth was formed.

Installing d3-tip

To use d3-tip, we first install it. It's easy.

@jsoma
jsoma / README.md
Last active October 10, 2019 23:57
Working with ai2html and sawhorse

Using ai2html and sawhorse: A walkthrough

So, you need to add an ai2html graphic to your sawhorse-driven page. Let's do it!

First, start with your .ai Illustrator file. You can start with something you exported already, but you can run into a lot of problems, so let's just start from the .ai.

Exporting from Illustrator

Open your Illustrator file up in Illustrator.

@jsoma
jsoma / README.md
Last active September 8, 2022 13:37
Installing cartopy inside of a pipenv virtual environment using GEOS/GDAL/PROJ from Homebrew

Install all of your "real" geo dependencies using homebrew

brew install proj
brew install geos
brew install gdal

Create your pipenv

@jsoma
jsoma / README.md
Last active January 25, 2024 14:44
Installing R that works in Jupyter without the 1997 American adventure horror thriller film Anaconda

Installing R in Jupyter notebooks without Anaconda

You need to already have Jupyter installed! If you don't have Python+Jupyter set up, you could use Python Wrangler or you can honestly just go install Anaconda to get started more quickly.

Download R

You can find it at https://cloud.r-project.org. It’s hard to figure out where exactly to go, so here are direct links that might be out of date:

@jsoma
jsoma / CORS.xml
Created September 4, 2020 21:08
CORS public access
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>
@jsoma
jsoma / CORS.json
Last active May 11, 2023 09:21
CORS public access (new JSON version)
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"PublicRead",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject","s3:GetObjectVersion"],
"Resource":["arn:aws:s3:::YOUR_BUCKET_NAME_GOES_HERE/*"]
}
@jsoma
jsoma / CORS.json
Created November 20, 2020 19:07
CORS configuration for AWS S3 public files
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
@jsoma
jsoma / README.md
Last active May 14, 2024 22:19
How to use pandoc and Markdown to build a simple reveal.js presentation (and a bit about how to customize it, too)

Requirements

First you need to install pandoc.

I used brew install pandoc to install via Homebrew since I'm on a mac.

Writing your presentation

Make a slides.md for your slides (or name it whatever you want!). I put images in an /images/ folder. You can see how links and images and all of that work from this sample:

@jsoma
jsoma / Using paginated APIs (4 ways!).ipynb
Created June 27, 2021 14:01
Paginated APIs with Python: Four ways!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.