Skip to content

Instantly share code, notes, and snippets.

View bogdanp05's full-sized avatar
👽

Bogdan Petre bogdanp05

👽
  • aiven.io
  • Berlin
View GitHub Profile
@dzabel
dzabel / brew_packages.sh
Last active January 15, 2020 23:15
update installed brew packages and push brew_packes to git, to get it work, your need to install "brew tap buo/cask-upgrade"
#!/bin/bash
dateValue=''
newDate=$(date +"%m_%d_%Y")
if [ -f /tmp/brew_update_date.txt ]; then
dateValue=$(</tmp/brew_update_date.txt)
fi
if [ ! -f /tmp/brew_upgrade.lock ]; then
touch /tmp/brew_upgrade.lock
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active August 2, 2025 20:45
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@mervintankw
mervintankw / validateUEN.js
Last active July 8, 2024 13:41
validates that UEN (Unique Entity Number) number is valid based on https://www.uen.gov.sg/ueninternet/faces/pages/admin/aboutUEN.jspx
/**
* validates UEN of businesses in Singapore
* https://www.uen.gov.sg/ueninternet/faces/pages/admin/aboutUEN.jspx
* @param {string} uen
* @returns {boolean}
*/
function validateUEN (uen) {
var debug = true;
const entityTypeIndicator = [
'LP', 'LL', 'FC', 'PF', 'RF', 'MQ', 'MM', 'NB', 'CC', 'CS', 'MB', 'FM', 'GS', 'GA',
@wojteklu
wojteklu / clean_code.md
Last active August 12, 2025 23:38
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

@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin [email protected]:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@telent
telent / gist:9742059
Last active December 28, 2024 15:25
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
@todgru
todgru / starttmux.sh
Last active September 26, 2024 04:28
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"