Skip to content

Instantly share code, notes, and snippets.

View RadoslawB's full-sized avatar
🎯
Focusing

Radosław Białowąs RadoslawB

🎯
Focusing
View GitHub Profile
@RadoslawB
RadoslawB / clean_code.md
Created May 25, 2020 20:43 — 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

@RadoslawB
RadoslawB / nosleep.sh
Created April 15, 2020 09:01
Completely disable sleep on any Mac
# Useful to prevent Macbooks to go to sleep when closing the lid instead of running tools that requires a Kernel Extension (e.g. InsomniaX) and more
# Before doing anything, save your current configuration using
pmset -g
# To disable sleep
sudo pmset -a sleep 0; sudo pmset -a hibernatemode 0; sudo pmset -a disablesleep 1;
# And to go back to normal
sudo pmset -a sleep 1; sudo pmset -a hibernatemode [original hibernatemode value]; sudo pmset -a disablesleep 0;
@RadoslawB
RadoslawB / letsencrypt
Created March 17, 2020 10:14 — forked from HarshadRanganathan/letsencrypt
Let's Encrypt SSL for Nginx in Amazon Linux AMI instance
# Install wget
yum install wget -y
# Install certbot-auto
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
# Obtain SSL certificate with Nginx plugin for the domain
sudo ./certbot-auto --nginx -d app.com --debug
@RadoslawB
RadoslawB / gist:5357ec038f758255849e3c2ad6794a92
Last active January 24, 2020 19:52 — forked from anthonyray/gist:398fde676a7704c03d6624155ba0011e
Set up OhMyZsh on Amazon EC2 instance running Ubuntu Server 14.04
  1. Connect to your EC2 instance
  2. Install zsh : sudo apt-get update && sudo apt-get install zsh
  3. Edit your passwd configuration file to tell which shell to use for user (check with whoami):sudo vim /etc/passwd`
  4. Look for ubuntu user, and replace bin/bash by bin/zsh
  5. Install OhMyZsh : sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  6. Disconnect from your instance and reconnect it.
  7. git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
  8. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
  9. Add in .zshrc line: plugins=(git zsh-autosuggestions zsh-syntax-highlighting). Remember to remove previous plugins=(git)