Skip to content

Instantly share code, notes, and snippets.

View mmajewsk's full-sized avatar
🏠
Working from home

mwmajewsk mmajewsk

🏠
Working from home
View GitHub Profile
@mmajewsk
mmajewsk / node.py
Created June 21, 2015 09:23
A-star python pathfinding algorithm
__author__ = 'hawker'
import math
class Node:
xPos = 0 # x position
yPos = 0 # y position
distance = 0 # total distance already travelled to reach the node
priority = 0 # priority = distance + remaining distance estimate
def __init__(self, xPos, yPos, distance, priority):
self.xPos = xPos
self.yPos = yPos
@mmajewsk
mmajewsk / xethzeur.py
Created November 24, 2021 09:40
snippet for viewing ETH EUR trading pair from kraken in XFCE
import requests
r = requests.get("https://api.kraken.com/0/public/OHLC?pair=XETHZEUR&interval=60")
data = r.json()
viewable = data['result']["XETHZEUR"][-1][-3]
print(viewable[:-3]+'€')
@mmajewsk
mmajewsk / install_orbslam_stuff.sh
Created July 8, 2019 00:11 — forked from ducha-aiki/install_orbslam_stuff.sh
Install ORBSLAM + python bindings
#!/bin/bash
DIR1=$(pwd)
MAINDIR=$(pwd)/3rdparty
mkdir ${MAINDIR}
cd ${MAINDIR}
conda create -y -n "NavAgents" python=3.6
source activate NavAgents
conda install opencv -y
conda install pytorch torchvision -c pytorch -y
@mmajewsk
mmajewsk / Part2-foobar.ipynb
Created August 4, 2020 15:08
Why i hate matplotlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mmajewsk
mmajewsk / .dir-locals.el
Created July 28, 2020 14:22
Emacs problem
((nil . ((eval . (
defvar projectile-main-project "/home/mwm/repositories/LHCb/ml_analysis_recreation"
)))))
@mmajewsk
mmajewsk / readme.md
Last active January 4, 2020 11:19
git use credentials fron commit

If you are lazy and want to set up credentials as in last commit

git config user.name $(git log --format='%an' -1)
git config user.email $(git log --format='%ae' -1)
@mmajewsk
mmajewsk / dyntyphint.py
Created February 6, 2019 21:10
Dynamic type hinting in python
import random
from typing import get_type_hints
class Bar:
def foo(self, a: str) -> int:
return 1
class fakedict(dict):
@mmajewsk
mmajewsk / monitor_setting.md
Created September 10, 2018 09:32
monitor setting
no LGD 0x40a0 0x00000000 1366 768 60
@mmajewsk
mmajewsk / Part3-Copy1.ipynb
Created January 3, 2018 11:39
Pandas missaligned bars and ticks of bar plot
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mmajewsk
mmajewsk / imu_interceptor.py
Created January 2, 2018 14:52
Python snippet for reading minimu9-ahrs output
import subprocess
import multiprocessing
class MultiImuSubprocess(multiprocessing.Process):
def __init__(self, result_queue, death_pill_queue, cmd, *args, **kwargs):
multiprocessing.Process.__init__(self)
self.result_queue = result_queue
self.death_pill_queue=death_pill_queue
self.data = None