Skip to content

Instantly share code, notes, and snippets.

View rowinf's full-sized avatar
👋
Looking for work

Rob rowinf

👋
Looking for work
View GitHub Profile
/**
* generate unique lyrics so the syllables add up to a number
*/
const WORDS = [null, "gang", "gucci"]
function syllableLength(lyrics) {
return lyrics.reduce((total, word) => {
return total + WORDS.indexOf(word)
}, 0)
@rowinf
rowinf / row-text-to-csv.awk
Last active December 15, 2024 23:00
concatenate text that was stripped from html table and format it as a csv
###
# this text was processed from a curl + pup command
# surrounding html tags were stripped from the text
# each line of text was from a table cell
# recombine table cells into a csv
###
NR < 16 {
headers = (headers == "" ? $0 : headers ", " $0)
next
}
"
" Gist url
" https://gist.github.com/rowinf/65b3126f812b6e2985ed828d8bdd9e5f
"
" Normally this if-block is not needed, because `:set nocp` is done
" automatically when .vimrc is found. However, this might be useful
" when you execute `vim -u .vimrc` from the command line.
if &compatible
" `:set nocp` has many side effects. Therefore this should be done
@rowinf
rowinf / sa2-centroids.geojson
Last active July 16, 2020 02:46
Stats NZ 2018
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function getRandom(min, max) {
return Math.round(Math.random() * (max - min) + min);
}
const generate = () => {
const selected = []
let max = 9
let prev = null
for (let i = 0; i < 4; i++) {

Keybase proof

I hereby claim:

  • I am rowinf on github.
  • I am rowinf (https://keybase.io/rowinf) on keybase.
  • I have a public key ASDqTc5Eb7oYlwFHypy2UYLfFBkPjFuKdTq2sPlRXinIKwo

To claim this, I am signing this object:

@rowinf
rowinf / gist:583fcbafe28d24eae323
Last active June 7, 2021 14:15
react-chartjs line chart example
import React from 'react';
import {Line as LineChart} from 'react-chartjs';
function chartData() {
return {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'My First dataset',