Skip to content

Instantly share code, notes, and snippets.

Avatar

Angelo Zehr angelozehr

View GitHub Profile
@angelozehr
angelozehr / shape2topo.js
Created Oct 31, 2019
How to convert a shapefile of swiss municipalities (or anything really) to topo.json
View shape2topo.js
var fs = require('fs')
var shapefile = require('shapefile')
var topojson = require('topojson-server')
var { polygon } = require('@turf/helpers')
var area = require('@turf/area').default
var polylabel = require('polylabel')
// specify the output file here
const inputFile =
'./gd-b-00.03-875-gg19/ggg_2019-LV95/shp/g2g19.shp'
View relief-nz.Rmd
```{r}
# read in geotif as raster
relief <- raster("/Users/zehran/Downloads/srgyhii200l_nt00248/srgyhii200l.tif") %>%
# convert to data frame
as("SpatialPixelsDataFrame") %>%
as.data.frame() %>%
rename(value = `srgyhii200l`) %>%
# filter out blues in geotif
# this reduces the number of rows from 16m to 420k
@angelozehr
angelozehr / Annotations.js
Last active Mar 21, 2018
Making of 20 Years 20 Titles
View Annotations.js
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { mediaBreakpointUp } from 'assets/Helpers.js'
export class SwoopyArrow extends Component {
render () {
const {
index,
x,
@angelozehr
angelozehr / Readme.md
Last active Jul 29, 2021
set up UTS PostgreSQL Database
View Readme.md
View TemperatureChart.js
/* react */
import React, {PureComponent} from 'react'
/* libraries */
import PropTypes from 'prop-types'
import classnames from 'classnames'
import { select } from 'd3-selection'
import { format, formatDefaultLocale } from 'd3-format'
import { scaleLinear, scalePoint } from 'd3-scale'
import { line, curveCardinal } from 'd3-shape'
View keybase.md

Keybase proof

I hereby claim:

  • I am angelozehr on github.
  • I am angelozehr (https://keybase.io/angelozehr) on keybase.
  • I have a public key whose fingerprint is B62A F3B4 FC40 F496 AC56 FEE6 D30F 9ACA 7EBC 83F9

To claim this, I am signing this object: