Skip to content

Instantly share code, notes, and snippets.

View b3z's full-sized avatar
🚿
showering

b3z

🚿
showering
  • 01:50 (UTC +01:00)
View GitHub Profile
@b3z
b3z / pylsp.lua
Created June 14, 2023 13:14
Disable line to long warning in pylsp lua neovim and disable linebreaks when formatting
return {
settings = {
pylsp = {
plugins = {
pycodestyle = {
ignore = {'E501'}, -- This is the Error code for line too long.
maxLineLength = 200 -- This sets how long the line is allowed to be. Also has effect on formatter.
},
},
},
@b3z
b3z / ixDelAll.py
Last active December 1, 2021 09:55
Delete all ix.io entries of a user. (auth required in .netrc)
import requests
import re
user = "b3z"
response = requests.get(f"http://ix.io/user/{user}")
if response.status_code != 200:
print (f"Error:{response.status_code}")
res = re.compile("href=\"\/[a-zA-Z0-9]{4}\"").findall(str(response.content))
@b3z
b3z / nio_env.yml
Created November 18, 2021 18:17
A working PyNio environment for conda
name: nio
channels:
- conda-forge
- defaults
dependencies:
- boost-cpp=1.72.0=hdf9ef73_0
- bzip2=1.0.8=h0d85af4_4
- c-ares=1.18.0=h0d85af4_0
- ca-certificates=2021.10.8=h033912b_0
- cairo=1.16.0=hec6a9b0_1003
@b3z
b3z / olatDark.js
Last active November 14, 2021 15:32
Crappy OLAT Darkmode. But better than burning Eyes - paste in site inspect console - mod of MartB
(function() {
'use strict';
var cssStuff = "";
function addGlobalStyle(css) {
cssStuff += css + "\n";
}
function loadGlobalStyle(css) {
var html, style;
@b3z
b3z / SimplexSolverExample.java
Last active November 26, 2021 06:44
Apache Commons math3 Simplex solver example
import java.util.ArrayList;
import java.util.Collection;
import org.apache.commons.math3.optim.MaxIter;
import org.apache.commons.math3.optim.PointValuePair;
import org.apache.commons.math3.optim.linear.LinearConstraint;
import org.apache.commons.math3.optim.linear.LinearConstraintSet;
import org.apache.commons.math3.optim.linear.LinearObjectiveFunction;
import org.apache.commons.math3.optim.linear.NonNegativeConstraint;
import org.apache.commons.math3.optim.linear.Relationship;
@b3z
b3z / .gitignore
Last active September 1, 2022 17:29
My tex gitignore
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.soc
*.toc
@b3z
b3z / inverse.py
Last active November 26, 2021 06:52
Multiplicative inverse element modulo n
def euka(a, b):
u, v, s, t = 1, 0, 0, 1
while b!=0:
q=a//b
a, b = b, a-q*b
u, s = s, u-q*s
v, t = t, v-q*t
return a, u, v
def modinverse(a, n):
@b3z
b3z / otfSVD.java
Last active November 26, 2021 06:55
On the fly version polynomapproximation singular value decomposition
import org.apache.commons.math3.linear.Array2DRowRealMatrix;
import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.linear.SingularValueDecomposition;
public class Test3 {
public static void main(String[] args) {
double [][] data = {{12, 25425.6}, {15, 49816.5}, {23, 180506.9}, {27, 292460.1}};
int numCoefficients = 4; // 4 means a polynomial of rank 3 --> x3 + x2 + x1 + d
@b3z
b3z / binding.md
Last active November 17, 2024 17:34
DDNet binding cheatsheet

Teewords config cheatsheet

In this repository you will find a collection of teeworlds binds, configs and scripts which you can use in your settings_ddnet.cfg

If you feel like a bind is missing please contribute.


How binding works

@b3z
b3z / resize.sh
Created September 17, 2020 11:04
Multi image resizing
#!/bin/bash
for f in p*.[jJ][pP][gG]
do
echo $f
convert $f -resize 1024x683^ -gravity center -extent 1024x683 print_$f
done
# resizes all jpgs in a dir to 1024x683 px with gravity centered:wq