Skip to content

Instantly share code, notes, and snippets.

@Faolain
Faolain / raster2zarr.py
Created June 15, 2022 14:14 — forked from lucaswells/raster2zarr.py
Convert GeoTIFF to Zarr array
import matplotlib.pyplot as plt
import rasterio
from rasterio.windows import Window
import time
import zarr
def convert(raster_filepath, chunk_mbs=1):
"""
Converts raster file to chunked and compressed zarr array. Tested
@media only screen and (max-width: 413px) {
}
@media only screen and (min-width: 414px) and (max-width: 767px) {
}
@media only screen and (min-width: 768px) and (max-width: 1023px) {
}
@media only screen and (min-width: 1024px) and (max-width: 1279px) {
@Faolain
Faolain / README.md
Created November 25, 2020 00:05 — forked from sambacha/README.md
A general Boilerplate README file for Improvement Proposals

Boilerplate Proposal README file

Changes

-- Added SECURITY section

-- Added 'Libraries' to ## Terminology

-- Added explicit ## LICENSE section

@Faolain
Faolain / GitHub-Forking.md
Created October 21, 2020 07:28 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@Faolain
Faolain / Flexible Dockerized Phoenix Deployments.md
Created November 18, 2018 07:40 — forked from jswny/Flexible Dockerized Phoenix Deployments.md
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

@Faolain
Faolain / phoenix_to_umbrella
Created March 15, 2018 16:35 — forked from emilsoman/phoenix_to_umbrella
How to move an existing phoenix app under an umbrella app
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
@Faolain
Faolain / seed.ex
Created April 23, 2017 03:58 — forked from jerel/seed.ex
Run seeds in an Elixir Distillery app
defmodule :release_tasks do
def seed do
:ok = Application.load(:myapp)
[:postgrex, :ecto, :logger]
|> Enum.each(&Application.ensure_all_started/1)
Myapp.Repo.start_link
@Faolain
Faolain / poolboy_demo.ex
Created January 16, 2017 05:37 — forked from henrik/poolboy_demo.ex
Example of using Poolboy in Elixir to limit concurrency (e.g. of HTTP requests).
defmodule HttpRequester do
use GenServer
def start_link(_) do
GenServer.start_link(__MODULE__, nil, [])
end
def fetch(server, url) do
# Don't use cast: http://blog.elixirsips.com/2014/07/16/errata-dont-use-cast-in-a-poolboy-transaction/
timeout_ms = 10_000