Skip to content

Instantly share code, notes, and snippets.

View filipgorczynski's full-sized avatar
🚀
Pursue Focus

Filip Górczyński filipgorczynski

🚀
Pursue Focus
View GitHub Profile
@filipgorczynski
filipgorczynski / oserror.gdal.sh
Last active November 13, 2019 10:05
Python OSError and GDal library
dnf list installed | grep -i gdal
# ...
gdal30-libs.x86_64 3.0.1-4.f29 @pgdg11
# ....
dnf history
# ...
Ident. | Wiersz poleceń | Data i czas | Działania | Zmien.
-------------------------------------------------------------------------------
297 | update | 2019-11-07 07:49 | Upgrade | 7 EE
296 | update | 2019-11-06 06:51 | I, U | 8 EE
dist: xenial
notifications:
email: false
sudo: required
language: python
python:
- "3.7"
cache:
pip: true
addons:
before_install:
# ...
-sudo service xvfb stop
-sudo sed -i 's/1024x768/1280x1024/g' /etc/systemd/system/xvfb.service
-sudo service xvfb start
# ...
@filipgorczynski
filipgorczynski / .gitconfig
Created May 1, 2019 04:53
.gitconfig example aliases
[alias]
st = status
ci = commit
br = branch -v
co = checkout
df = diff
lg = log -p
up = pull
who = shortlog -s --
diff = diff --no-prefix
@filipgorczynski
filipgorczynski / extract.awk
Created March 8, 2019 11:44
Extract emails from JSON files
grep "email" file.json | gawk '{print $2}'
"""
1. Go to https://youtube-playlist-analyzer.appspot.com/
2. Enter playlist URL
3. Copy playlist table and paste to text editor
4. Search and Replace with Regex (notice XX is the playlist size)
SEARCH: ^(\d+)\s+(.*)\t([-_A-Za-z0-9]+)\t(\d{2}:\d{2}:\d{2})
REPLACE: **$1/XX** [$2](https://www.youtube.com/watch?v=$3) _$4_
"""
"\+\n" -> ""
"\d+ lectures\n" => ""
"^(\d+:\d+(:\d+)?)" -> "_$1_"
"([^\d_])\n" -> "$1 "
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
class Celsius:
__multiplier = 1.8
def __init__(self, temperature = 0):
self._temperature = temperature
def to_fahrenheit(self):
return (self._temperature * 1.8) + 32
def get_temperature(self):
@filipgorczynski
filipgorczynski / MP4toAVI.movies.converter.py
Created September 27, 2018 13:14
A friend from work is saying that it's useful for previously downloaded PornHub movies.
# Just a simple tool to convert mp4 files to avi.
import os
import subprocess
import glob
path = '.'
files = glob.glob('*.mp4')
files_count = len(files)
for index, name in enumerate(files, start=1):