Skip to content

Instantly share code, notes, and snippets.

View Addono's full-sized avatar
🛠️
Solving software problems, one line of code (or long Slack message) at a time

Adriaan Knapen Addono

🛠️
Solving software problems, one line of code (or long Slack message) at a time
View GitHub Profile
@Addono
Addono / Merge choose other RegEx
Created February 26, 2017 11:53
Chooses the merge branche for all merge conflict markers.
<<<<<<< HEAD[\s\S]*?=======([\s\S]*?)>>>>>>> upstream/master
$1
@Addono
Addono / download.py
Last active December 16, 2019 21:37
File downloader Python, both sequential including status updating with tqdm or
from tqdm import tqdm
import urllib.request
urls = ["https://www.photobookselysee.ch/iiif/77-071_OOR_Een-Staat-In-Wording___%s/full/full/0/default.png" % i for i in range(1, 70)]
print("Downloading:")
print("\n".join(urls))
for index, url in tqdm(enumerate(urls), unit="pages", total=len(urls)):
file_name = "OOR_Een-Staat-In-Wording_Page_%s.png" % index
@Addono
Addono / book_names.csv
Created December 22, 2019 15:59
Dutch Fiction Book Names released in 2019 (https://github.com/Addono/worldcat-scraper)
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
title:
Mia en de asielhond
De erfenis van Abiola
Hoek
De hemel verslinden
Fobo wil niet naar de dokter
De terugkeer van de koningin
De hut van das
Waar is de draak?
De fluisteraar : literaire thriller
@Addono
Addono / books.csv
Created December 23, 2019 12:47
Dutch book titles from 2019 according to book.be. (Scraped using https://github.com/Addono/bookbe-spider)
We can't make this file beautiful and searchable because it's too large.
title:
What is left unseen
Uncorrected proof : Ine Schröder
India = Inde = Indien = Índia
[Mondo Cane] : [La Biennale di Venezia : 58. Esposizione Internazionale d'Arte : Partecipazioni Nazionali]
Round trip
Narcisse Tordoir & Fendry Ekel
"American national parks = Les parcs nationaux américains : pacific islands, western & southern USA"
Virtuous situations from the industrial past and some ideas for the 'climatic metropolis' to come : cases of Brussels and Paris = Situations vertueuses du passé industriel et quelques idées pour la métropole climatique à venir : les cas de Bruxelles et Paris = Deugdelijke situaties uit het industriële verleden en een aantal ideeën voor de klimaatmetropool van de toekomst : Brussel en Parijs
Sven Augustijnen & Sammy Baloji
@Addono
Addono / replace-author.sh
Last active January 3, 2020 21:52
Git reset author bulk
git rebase --onto HEAD~6 --exec "git commit --amend --reset-author --no-edit" HEAD~6
@Addono
Addono / 01_validPointClaimQuery.graphql
Last active June 5, 2021 19:51
Some GraphQL queries to hit the ground running with https://api.claimr.tools. Make sure to get an API key at https://dashboard.claimr.tools and add it as the "Authorization" HTTP header with value "Bearer API_KEY".
query ValidPointClaimRequest {
verifyLocation(
tokenRequest: {
claim: {
point: {
location: { latitude: 52.9519, longitude: -1.1841 }
radius: 100
}
}
}
{
"errors": [
{
"message": "Request failed with status code 404",
"locations": [
{
"line": 2,
"column": 3
}
],
@Addono
Addono / add-yaml-lint.sh
Last active October 4, 2020 20:35
Installs yaml-lint as a dependency and creates a pre-commit hook which invokes it using husky.
#!/bin/sh
# Add yaml-lint as a dependency
yarn add -D yaml-lint
# Add a lint script
npx json -I -f package.json -e "this.scripts.lint='yamllint *.{yaml,yml}'"
# Add husky as a dependency
yarn add -D husky
@Addono
Addono / docker-compose.yaml
Created April 5, 2020 18:55
Create an Apache Zeppelin container with Docker Compose
zeppelin:
image: apache/zeppelin:0.9.0
environment:
ZEPPELIN_LOG_DIR: /logs
ZEPPELIN_NOTEBOOK_DIR: /notebook
volumes:
- ./logs:/logs
- ./notebook:/notebook
- ./helium:/zeppelin/helium
@Addono
Addono / apollo-client-server-side.ts
Last active July 2, 2020 11:13
Server side Apollo Client usage example
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'
// Create GraphQL Client for FaunaDB, replace HttpLink configuration
// with your own GraphQL endpoint configuration.
const client = new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
uri: 'https://graphql.fauna.com/graphql',
headers: {
"Authorization": `Bearer ${process.env.FAUNADB_SECRET}`,