Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 22:10
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

@Joao-Peterson
Joao-Peterson / gmk67-manual.md
Last active May 7, 2024 22:08
GMK67 manual (English)
@deepanchal
deepanchal / starship.toml
Last active May 7, 2024 22:08
Starship config
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
format = """
$username\
$hostname\
$localip\
$shlvl\
$singularity\
$kubernetes\
@blackbing
blackbing / fetchStream.js
Last active May 7, 2024 22:07
Server Sent Event with fetch stream
const url = 'https://api.example.com/v1/sse';
const accessToken = 'test';
fetch(url, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})
.then(response => {
if (response.ok && response.body) {
reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
@unstppbl
unstppbl / go_time_parsing.md
Last active May 7, 2024 22:06
Parsing custom time layout in Golang

There are some key values that the time.Parse is looking for.

By changing:

test, err := time.Parse("10/15/1983", "10/15/1983")

to

@blazewicz
blazewicz / pyenv-install.sh
Last active May 7, 2024 22:02
pyenv - Install Python 3.x with optimizations on macOS with macports
#!/bin/bash
set +x
PY_VERSION=3.10.1
export MAKE_OPTS="-j4"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-framework"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-computed-gotos"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-system-expat"
@taoyuan
taoyuan / generate_self_signed_certification.md
Last active May 7, 2024 22:01
Generation of a Self Signed Certificate

Generation of a Self Signed Certificate

Generation of a self-signed SSL certificate involves a simple 3-step procedure:

STEP 1: Create the server private key

openssl genrsa -out cert.key 2048

STEP 2: Create the certificate signing request (CSR)

openssl req -new -key cert.key -out cert.csr
@matthewjberger
matthewjberger / instructions.md
Last active May 7, 2024 22:01
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

How to get local administrator on an organisation-owned machine

Important

I am not liable or responsible for any damage caused by attempting this or any punishment by your organisation for bypassing organisation-owned monitoring software. Only use this at your own risk and ensure you have sufficient expertise to perform such a task.

Prerequisites

  • Another machine, running Windows
  • A USB flash drive with at least 8GB of free storage
  • A stable internet connection
  • Ensure USB-A ports are recognized by your machine for hardware other than peripherals (if you have an unlocked BIOS you may have to enable flash storage to be recognized first)
  • Ensure that you are alright with losing all of the information currently on the device; this includes making sure you've backed up any files you deem important.