Skip to content

Instantly share code, notes, and snippets.

View oerpli's full-sized avatar
🐱
:octocat:

Abraham Hinteregger oerpli

🐱
:octocat:
View GitHub Profile
from collections import Counter, defaultdict
from pathlib import Path
from typing import List, Mapping, Tuple
from aocd.models import Puzzle
from dotenv import load_dotenv
load_dotenv() # API key in .env
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["figure.dpi"] = 250
delta_r0 = 1.2
omicron_r0 = 1.35
hosp_fraction = 0.05
icu_fraction = 0.30
marshmallow:
Installed: 2.19.5
Newest: 3.0.0b8
Newer: 3.0.0b8
matplotlib:
Installed: 3.0.3
Newest: 3.1.0
Newer: 3.1.0
sip:
Installed: 4.19.8
@oerpli
oerpli / MakeMediumReadadableUserscript.user.js
Created March 25, 2019 11:54 — forked from luke3butler/MakeMediumReadadableUserscript.user.js
Userscript version of the MMRA (Make Medium Readable Again) Chrome extension
// ==UserScript==
// @name Make Medium Readable Userscript
// @namespace http://make.medium.readable.again
// @version 0.1
// @description https://github.com/thebaer/MMRA
// @author luke3butler (Credits to Matt Baer)
// @match *://*/*
// @grant none
// ==/UserScript==
import pandas as pd
import Helpers
import matplotlib.pyplot as plt
import seaborn as sns
def ReduceListSeries(a: pd.Series, *, diff=0, rangeOnly=False):
"""Given a pd.Series of integers, this function returns a list of tuples
where each pair consists of the indexes of the boundaries (1st inclusive, 2nd exclusive [, 1st value])
@oerpli
oerpli / language_coalesce.sql
Last active March 3, 2019 20:06
Coalesce translations according to language priority
drop extension if exists tablefunc;
drop table if exists texts;
drop table if exists langs;
-- load tablefunc extension for crosstab
create extension tablefunc;
-- crosstab only allows single column - define int and varchar tuples for this purpose
DROP TYPE IF EXISTS intT;
CREATE TYPE intT AS (module int, id int );
# https://techdevguide.withgoogle.com/resources/compress-decompression/#!
def decomp(s,i = None):
i = [0] if i is None else i
number = 0
out = []
while i[0] < len(s):
c = s[i[0]]
i[0] += 1
if c == ']':
return out
import java.io.PrintWriter
// import java.util
import org.apache.spark.sql.DataFrame
// import org.apache.spark.sql.types.{LongType, StructField, StructType}
import org.apache.spark.sql.Row
import scala.collection.mutable
// import spark.implicits._
def fileWSL(n : String) = "/mnt/c/linking/git/Linkability/xmr_data/csv/chronologic_rings_" + n + ".csv" // from WSL use this path
@oerpli
oerpli / monero_reused_pubks.csv
Last active April 10, 2018 09:15
XMR TXOs that have pubkeys that occur multiple times.
We can't make this file beautiful and searchable because it's too large.
time,block,txhash,pubk
2014-09-02 13:39:59,200382,86c73c157e6fe10aa98c78f25d5a42dbc531e697cd8a366b1292e71cf372b33b,9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071
2014-09-02 14:00:19,200401,1a24eea7554d5d2e8f2d5c4fdbbb00bb5ec4ba4718681dd46f0718675d1a5efc,9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071
2014-09-02 14:02:57,200403,4830bc5494495da0cfca8c7d458056db2ac19bee90f5a005570413b89f707eb7,9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071
2014-09-02 14:03:46,200404,171a1f15220686c237fbed2cfa3fdafdb4ae110958af8bdf2b82f3401a6d1581,9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071
2014-09-02 14:05:03,200405,91bc31697eff09bbe33502b416233d262500631878bbdc6aa1d21845c475255d,9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071
2014-09-02 14:05:28,200406,47b96d7e064fdf58097848c6876c82e17a942030a4f42ff0701ca82f2dc954a1,9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071
2014-09-02 14:06:01,200407,f274841ea2590bdc5471447fc8ac8f26
@oerpli
oerpli / GoPieces.user.js
Created February 28, 2018 20:53
Userscript that replaces the chess pieces on Lichess with Go stones. The intention is to provide a compromise between playing blind and non-blind chess.
// ==UserScript==
// @name Lichess Pieces: Go
// @namespace http://userstyles.org
// @description Go stones instead of chess pieces. Choose CANVAS board theme to activate the style.
// @author oerpli
// @homepage https://userstyles.org/styles/135471
// @include http://lichess.org/*
// @include https://lichess.org/*
// @include http://*.lichess.org/*
// @include https://*.lichess.org/*