Skip to content

Instantly share code, notes, and snippets.

View jvanlier's full-sized avatar

Jori van Lier jvanlier

View GitHub Profile
@jvanlier
jvanlier / !Dotfiles-setup.md
Last active November 19, 2020 08:47
Dotfiles

todo

Put in a repo and make bootstrap scripts for mac and linux.

zsh

First, install zsh using package manager (e.g. apt install zsh). Then set as default (password prompt):

$ chsh -s /bin/zsh

Then oh my zsh and zsh-autosuggestions:

@jvanlier
jvanlier / fast.ai-vision-raspberry-pi-4.md
Last active September 8, 2022 04:45
fast.ai for vision on Raspbery pi 4 (Raspbian)

By default, PyTorch team doesn't release packages for ARM architecture. Luckily, someone is supplying unofficial builds (hats off to this person!).

Fast.ai also has a problem: it depends on spaCy, which also doesn't want to build on ARM by default. I'm not going to do NLP, so will install fast.ai without spaCy.

PyTorch

I initially tried using ARM builds from here:

https://github.com/nmilosev/pytorch-arm-builds

@jvanlier
jvanlier / postgres_superset.md
Created August 9, 2017 09:00
Postgres & Superset

Postgres & Superset

Postgres Installation

$ docker pull postgres
$ docker run --name ss-pg -e POSTGRES_PASSWORD=secret -d -p 5432:5432 postgres

This pulls the Postgres image and runs it with name ss-pg. You'll probably want to pick a better password than just secret. This is the password for the postgres admin user. The option -p 5432:5432 makes the Postgres instance available on localhost on port 5432, which will be convenient later when we fill it with data.

@jvanlier
jvanlier / StormTestExample.java
Last active September 30, 2019 15:17
Storm unit testing - BaseBasicBolt vs BaseRichBolt
import java.util.Map;
import org.apache.storm.Config;
import org.apache.storm.ILocalCluster;
import org.apache.storm.Testing;
import org.apache.storm.generated.StormTopology;
import org.apache.storm.spout.SpoutOutputCollector;
import org.apache.storm.task.OutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.testing.CompleteTopologyParam;
import org.apache.storm.testing.MkClusterParam;
@jvanlier
jvanlier / gist:3685f9c748c0af6169d9
Created June 8, 2015 15:55
Messagebird implementatie hack & fly
#!/usr/bin/env python
import messagebird
class SmsException(Exception): pass
class SmsConnector:
api_key = 'xxx'
def __init__(self):
self.client = messagebird.Client(self.api_key)
@jvanlier
jvanlier / gist:7156eea5e9fe43b37070
Created January 22, 2015 16:59
Random kamer picker
#!/usr/bin/python
import random
wintersporters = ['jan', 'jori', 'sander', 'erik', 'faab', 'gossie', 'maarten', 'justin']
room_one = random.sample(wintersporters, len(wintersporters)//2)
room_two = filter(lambda x: x not in room_one, wintersporters)
print('Kamer 1: %s ' % room_one)
print('Kamer 2: %s ' % room_two)
[jorivanlier@gate-001 Hadoop_ReturnVisit]$ ./ReturnVisitAnalysis.py
[DEBUG] ApplicationId: kpmgRestaurant
measurementTimestamp lastSeenTimestamp tDiffSec tDiffDays
count 5.060000e+02 5.060000e+02 5.060000e+02 506.000000
mean 1.420460e+12 1.419093e+12 1.367332e+09 15.825605
std 6.961196e+06 5.102638e+08 5.088012e+08 5.888903
min 1.420443e+12 1.417697e+12 7.191615e+07 0.832363
25% 1.420456e+12 1.418813e+12 1.118531e+09 12.945955
50% 1.420458e+12 1.418989e+12 1.468340e+09 16.994682
75% 1.420460e+12 1.419338e+12 1.651124e+09 19.110230