Skip to content

Instantly share code, notes, and snippets.

View georgescumihai's full-sized avatar

Mihai Georgescu georgescumihai

  • NAO Future Technologies
  • Santa Cruz de Tenerife
View GitHub Profile
@georgescumihai
georgescumihai / prepare-commit-msg
Last active October 4, 2024 14:07
Git pre commit hook to add the jira ticket id to the commit message
#!/bin/sh
#
# A hook script to prepare the commit log message.
# If the branch name it's a jira Ticket.
# It adds the branch name to the commit message, if it is not already part of it.
# https://stackoverflow.com/questions/5894946/how-to-add-gits-branch-name-to-the-commit-message/59831864#59831864
branchPath=$(git symbolic-ref -q HEAD) #Somthing like refs/heads/myBranchName
branchName=${branchPath##*/} #Get text behind the last / of the branch path

Keybase proof

I hereby claim:

  • I am georgescumihai on github.
  • I am georgescumihai (https://keybase.io/georgescumihai) on keybase.
  • I have a public key ASAG1hmEG53pI8Lq2lRBqkVAlheIJhk0Ji-Y9WKwwdkhkAo

To claim this, I am signing this object:

@georgescumihai
georgescumihai / pre-commit
Created May 18, 2020 13:16
Swiftformat pre-commit hook
#!/bin/sh
#
SWIFTFORMAT_FILEPATH=".swiftformat"
# Workaround for SourceTree
export PATH=/usr/local/bin:$PATH
git diff --diff-filter=d --staged --name-only | grep -e '\.swift$' | while read line; do
swiftformat --config $SWIFTFORMAT_FILEPATH $line "${line}";
git add "$line";
@georgescumihai
georgescumihai / WakeOnLan
Created November 1, 2020 14:18
Wake on lan bash script
#!/bin/bash
IP_ADDRESS="192.168.1.255"
MAC_ADDRESS="c2:91:f2:20:9F:65"
for i in $(seq 1 $END_PORT); do echo $i; done
END_PORT=10000
for ((i=1;i<=END_PORT;i++)); do
wakeonlan -i $IP_ADDRESS -p $i $MAC_ADDRESS
@georgescumihai
georgescumihai / screenshot.py
Last active December 23, 2020 12:31 — forked from fabtho/save_screenshot.py
make full screenshot with selenium in python, mobile and web
import os
import pathlib
from io import BytesIO
from urllib.parse import quote
from PIL import Image
# https://gist.github.com/fabtho/13e4a2e7cfbfde671b8fa81bbe9359fb
class Screenshot:
@georgescumihai
georgescumihai / screenshot_compare.py
Created December 23, 2020 12:36
Compare two screenshots for differences and highlight the differences
import base64
from dataclasses import dataclass
from typing import Any
import cv2
import imutils
import numpy as np
from skimage.metrics import structural_similarity
@georgescumihai
georgescumihai / VVTaxes.swift
Last active August 2, 2023 15:03
Calculator Taxation of VV
enum Constant {
static let igic: Double = 0.07
}
struct CostStructure {
let grossIncome: Double
let netIncome: Double
let otaCommission: Double
let managementCommission: Double