Skip to content

Instantly share code, notes, and snippets.

View Pan-Maciek's full-sized avatar
🤫

Maciej Kozieja Pan-Maciek

🤫
  • Qualtrics
  • Kraków
View GitHub Profile
Env:
  Ubuntu: 22.04
  Node: v16.17.0
  Npm: 8.15.0
  Java: openjdk 11.0.16
  Git: 2.34.1
  Docker: 20.10.12
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#define IDX(i, j, n) (((j)+ (i)*(n)))
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
const int grpcPort = 5000;
const int proxyPort = 3000;
var tcp1 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
@Pan-Maciek
Pan-Maciek / setup.sh
Created September 21, 2020 18:05
Instalacja sterowników
#!/bin/bash
# install video card driver (manjaro only)
echo "Attempting to install video card driver"
sudo mhwd -a pci nonfree 0300
# check kernel version
kv=$(uname -r | awk -F'.' '{print $1$2}')
echo "Attempting to install network card driver"
@Pan-Maciek
Pan-Maciek / vim
Created December 10, 2019 12:06
vim cheatsheat
Navigation
k
h l
j
H - move to top of screen
M - move to middle of screen
L - move to bottom of screen
K - open man page for word under the cursor
@Pan-Maciek
Pan-Maciek / kdtree.hs
Created December 4, 2019 20:28
Implementacja kd-drzewa.
import Data.List
data Tree a = EmptyNode
| Node { value:: a, low :: Tree a, high :: Tree a } deriving (Show)
type Point = [Int]
cmpAlong :: Int -> Point -> Point -> Ordering
cmpAlong ax p1 p2
| p1 !! ax > p2 !! ax = GT
@Pan-Maciek
Pan-Maciek / kdtree.js
Last active December 5, 2019 22:37
Implementacja kd-drzewa.
class Point extends Array {
get x() { return this[0] }
get y() { return this[1] }
set x(x) { this[0] = x }
set y(y) { this[1] = y }
}
const pointInRange = (point, min, max) => point.every((val, ax) => min[ax] <= val && val <= max[ax])
function medianPart(arr, ax) {
from tabula import read_pdf
df = read_pdf('k36.pdf', output_format='tsv')
print(df)
class Point extends Array {
get x() { return this[0] }
set x(val) { this[0] = val }
get y() { return this[1] }
set y(val) { this[1] = val }
get z() { return this[2] }
set z(val) { this[2] = val }
}
@Pan-Maciek
Pan-Maciek / bare.sh
Created November 8, 2019 22:23
Instruction on how to create dotfiles git bare repo.
mkdir ~/git
mkdir ~/git/dotfiles
# add alias
echo "alias config=$(which git) --git-dir=$HOME/git/dotfiles --work-tree=$HOME" >> .zshrc
source .zshrc
config config --local status.showUntrackedFiles no