Skip to content

Instantly share code, notes, and snippets.

View arkadiusjonczek's full-sized avatar
🏴‍☠️

Arkadius Jonczek arkadiusjonczek

🏴‍☠️
View GitHub Profile

the following regex will validate all examples provided here: https://www.conventionalcommits.org/en/v1.0.0/

  ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)

a grep/posix compatible variant

  ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([[:alnum:]._-]+\))?(!)?: ([[:alnum:]])+([[:space:][:print:]]*)
@arkadiusjonczek
arkadiusjonczek / clean_code.md
Created January 28, 2024 16:07 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@arkadiusjonczek
arkadiusjonczek / snippet.sh
Created August 10, 2021 21:41
Mount Volume C: in WSL #tags: wsl
sudo mount -t drvfs C: /mnt/c
@arkadiusjonczek
arkadiusjonczek / pdfcombine.sh
Created January 21, 2020 14:48
Combine pdf files using ghostscript #tags: bash
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=output.pdf input1.pdf input2.pdf input3.pdf
@arkadiusjonczek
arkadiusjonczek / query.sql
Created April 4, 2019 12:38
MySQL Show Primary Keys from Table #tags: MySQL
SHOW KEYS FROM users WHERE Key_name = 'PRIMARY'
@arkadiusjonczek
arkadiusjonczek / readme.me
Created February 20, 2019 12:59
Build Status Icon in GitHub Readme #tags: GitHub
[![Build Status](https://travis-ci.org/yourname/repository.svg?branch=master)](https://travis-ci.org/yourname/repository)
@arkadiusjonczek
arkadiusjonczek / phpunit.xml.dist
Created February 12, 2019 00:09
PHPUnit basic configuration #tags: PHP
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Default Test Suite">
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
@arkadiusjonczek
arkadiusjonczek / timezone.php
Created February 11, 2019 20:03
convert UTC datetime to local timezone #tags: PHP
<?php
date_default_timezone_set('Europe/Berlin');
$time = strtotime('2019-02-10 22:38:20 UTC');
$dateInLocal = date("Y-m-d H:i:s", $time);
print_r($dateInLocal);
@arkadiusjonczek
arkadiusjonczek / database.php
Created September 11, 2018 21:46
Use Laravel CLI (Artisan) local host and inside docker container #tags: PHP, Laravel
# add into config/database.php above config array
# if you use docker with laravel
if (php_sapi_name() == 'cli' && getenv('APP_ENV') == 'local') {
putenv('DB_HOST=127.0.0.1');
}
@arkadiusjonczek
arkadiusjonczek / screenshots.sh
Created July 24, 2018 15:42
Change Screenshots Directory #tags: macOS
# change to Screenshots directory
defaults write com.apple.screencapture location ~/Desktop/Screenshots/ && killall SystemUIServer
# change back to default Desktop directory
defaults write com.apple.screencapture location ~/Desktop/ && killall SystemUIServer