Skip to content

Instantly share code, notes, and snippets.

View joninvski's full-sized avatar

Joao Trindade joninvski

View GitHub Profile

How git works

Word of warning: you don't need to use the command line, but you need to know the basics. Please first know how to do things in their simplest form and only then move to magic GUIs.

Starting (or my very first two commits)

  1. It all starts with a git init
@joninvski
joninvski / OpenDay.md
Last active June 26, 2019 13:47
Onfido OpenDay

Convict the scammer 👮

Let's try the Onfido API. We have captured four criminals that we know have spoofed their IDs. Please use onfido to run checks on their ids.

Title First Name Last Name Email Country Address town Date of Birth
Miss Patricia Scarlett [email protected] PT Barreiro 08/08/1957
Professor Tom Plum [email protected] GB Liverpool 09/11/1948
Mrs Mafalda Peacock [email protected] PT Lisboa 28/07/1966

Python Example

Read csv

import csv
 
with open('suspects.txt') as csv_file:
    csv_reader = csv.reader(csv_file, delimiter=',')
 for row in csv_reader:

Ruby Example

Read csv

require 'csv'
 
data = CSV.read('suspects.csv')
 
data.each { |r|
@joninvski
joninvski / spec.json
Created October 30, 2020 15:56
Vega-Lite spec from Fri Oct 30 2020
{
"$schema":"https://vega.github.io/schema/vega-lite/v4.json",
"data":{
"url":"https://covid.ourworldindata.org/data/owid-covid-data.csv",
"format":{
"parse":{
"date":"date"
}
}
},
@joninvski
joninvski / spec.json
Created November 2, 2020 23:50
Vega-Lite spec from Mon Nov 02 2020
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"url": "https://covid.ourworldindata.org/data/owid-covid-data.csv",
"format": {"parse": {"date": "date"}}
},
"transform": [
{
"filter": {
"or": [