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 / .gitconfig
Created February 17, 2024 09:52
git.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
#/usr/bin/env python3
# 1 minute == 6 degrees
def getAngle(hours, minutes):
minutesAngle = minutes * 6
hoursAngle = 30 * hours + minutes // 12 * 6
return abs(hoursAngle - minutesAngle)
assert getAngle(0, 0) == 0 # degrees
@filipgorczynski
filipgorczynski / get_duplicates.py
Created August 17, 2022 06:38
Show elements duplicated in a list
from collections import Counter
data = ['a', 'b', 'c', 'c', 'a', 'd', 'e', 'd']
print(
list(item[0] for item in Counter(data).most_common() if item[1] > 1)
)
@filipgorczynski
filipgorczynski / main.yml
Created January 12, 2022 06:32
.github workflow to deploy changes
on: push
name: 🚀 Deploy blog posts on push
jobs:
web-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 🦄 Code checkout
uses: actions/checkout@v2.4.0
repos:
- repo: https://gitlab.com/pycqa/flake8.git/
rev: 3.8.4
hooks:
- id: flake8
name: Flake8 Py3
additional_dependencies: ['flake8-docstrings']
language_version: python3
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
name: Flake8 Py3
additional_dependencies: ['flake8-docstrings']
language_version: python3
#!/usr/bin/env python3
from datetime import datetime
import mmap
import os
from stat import *
from colorama import Fore, Style
WHITE = Fore.WHITE
#!/usr/bin/env python3
import math
import re
from PIL import Image, ImageColor, ImageDraw
COLORS_RE = r'(?:#|0x)(?:[a-f0-9]{3}|[a-f0-9]{6})\b|(?:rgb|hsl)a?\([^\)]*\)'
def create_color_palette(project_name, colors_set):
(function selectUnimportant() {
let files = document.querySelectorAll('.file');
for (let index = 0; index < files.length; ++index) {
let content = files[index].innerHTML;
if (content.indexOf('This file was deleted') !== -1 || content.indexOf('No changes.') !== -1) {
let checkbox = files[index].querySelector('.js-reviewed-checkbox');
if (!checkbox.checked) {
setTimeout(function() {checkbox.click(); }, 666);
}
}
@filipgorczynski
filipgorczynski / olx.homepage.robot
Created November 18, 2019 16:04
Simple example showing Robot Framework capabilities
*** Settings ***
Library SeleniumLibrary
Test Teardown Close Browser
*** Variables ***
${home_url}= https://olx.pl/
*** Keywords ***
User Opens Browser
Open Browser about:blank firefox