Skip to content

Instantly share code, notes, and snippets.

View barthr's full-sized avatar
🎯
Focusing

Bart barthr

🎯
Focusing
View GitHub Profile
@barthr
barthr / db_scan.py
Created January 16, 2018 11:16
Dbscan algorithm in python
import string
import numpy as np
UNCLASSIFIED = 0
OUTLIER = -1
class DBSCAN(object):
def __init__(self, epsilon=1.0, min_samples=10, dist=np.linalg.norm):
@barthr
barthr / action.go
Last active July 22, 2018 16:42
Wrapper for clean handlers in Go
package web
import (
"bytes"
"encoding/json"
"io"
"net/http"
)
type errorResponse struct {
@barthr
barthr / .tmux.conf
Created October 21, 2018 20:39
Tmux con from mac
set -g default-terminal "screen-256color"
set-window-option -g xterm-keys on
set-window-option -g mode-keys vi
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
# THEME
@barthr
barthr / ticketswap.js
Last active August 27, 2019 10:54
Javascript Ticketswap crawler
var current = window.location.href;
var party_url = "";//Typ hier je Feest url
var base_url = "https://www.ticketswap.nl";
$( document ).ready(function() {
if (current.indexOf("event") > -1) {
refreshPage();
}
else if (current.indexOf("listing") > -1){
orderCard();
@barthr
barthr / correlation.go
Last active March 21, 2023 15:09
Spearman and pearson correlation in Go
package stats
import (
"errors"
"math"
"sort"
)
// Correlator represent the contract for a correlation algorithm
// It contains 2 arguments which represent the datasets where the
package main
import (
"fmt"
"log"
"os"
"sync"
"time"
)