Skip to content

Instantly share code, notes, and snippets.

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

@inchoate
inchoate / readme.md
Last active May 7, 2024 23:04
Open clicked URLs into a particular Google Chrome profile

Problem

When I click on links from Slack or Outlook on MacOS they open in seemingly random browser windows/profiles. This is annoying.

Solution

Open links in a particular google chrome profile window. Be less annoyed.

  1. In Chrome, visit chrome://version and find the desired profile name. Mine was Default. Copy that profile's directory name, like Profile 2 or Default, not the profile's vanity name you see when you click on your profile icon in the browser.
  2. Install Finicky: brew install finicky. After install it should be running and you should see the icon in the upper toolbar.
  3. From the Finicky Toolbar Item, click > Config > Create New
  4. Edit the new file ~/.finicky and make it look something like this, filling in your profile name:
@serge-kilimoff
serge-kilimoff / watchdog_persistent_observer.py
Last active May 7, 2024 23:00
Persistent watchdog observer. When watchdog re-start, check if new/modify/delete/etc.. files or directories since the last launch, and send events for suscribers handlers.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Subclassing Observer for saving states of folders, and load this states at the next observation.
TODO : mapping events and handlers dispatching, for a shorter code.
"""
from __future__ import unicode_literals, print_function, division
import cPickle as pickle
import os
@bahadiraraz
bahadiraraz / Git_Commit_Freeze_Solution.md
Last active May 7, 2024 22:51
Git Commit Freeze Due to GPG Lock Issues (Solution)

Git Commit Freeze Due to GPG Lock Issues

If you encounter a problem where you cannot commit changes in Git – neither through the terminal nor via the GitHub Desktop application – the issue might be a freeze during the Git commit process. This is often caused by GPG lock issues. Below is a concise and step-by-step guide to resolve this problem.

Solution Steps

1. Check for GPG Lock Messages

Open your terminal and try to perform a GPG operation (like signing a test message). If you see repeated messages like gpg: waiting for lock (held by [process_id]) ..., it indicates a lock issue.

@kosh30
kosh30 / update-all-asdf-plugins.sh
Created December 4, 2023 21:53
Install or update all asdf plugins defined in ~/.tool-versions files.
#!/usr/bin/env bash
#export GITHUB_API_TOKEN=""
function log() {
printf "%s %s\n" "->" "$1"
}
CHECK_SYMBOL='\u2713'
X_SYMBOL='\u2A2F'
function execute_and_wait() {
@Klerith
Klerith / pasos-node-typescript.md
Last active May 7, 2024 22:47
Configurar proyecto de Node con TypeScript

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
@Minionguyjpro
Minionguyjpro / Activate_Windows_8_8.1_10_and_11_Pro_for_Free.md
Last active May 7, 2024 22:45
Activate Windows 8, 8.1, 10 and 11 Pro for Free

Activate Windows 8, 8.1, 10 and 11 Pro for Free

A guide how to get and activate Windows 8, 8.1, 10 and 11 Pro for free!

NOTE

If you see the Windows keyboard button in this guide; and you can't find it on your keyboard, you likely have/had Windows 10 which has the button . If you can't find that one, you likely have a PC that has been upgraded to Windows 8/8.1/10/11 from Windows 8.1/8/7/Vista/XP and other ones. If you have one of those, refer the Windows key button to as yours. A list of them is below:

Windows key buttons

- Windows 11

- Windows 10

@mofesolapaul
mofesolapaul / nigeria-states.json
Last active May 7, 2024 22:43
List of all Nigerian states, alphabetically arranged in JSON array
[
"Abia",
"Adamawa",
"Akwa Ibom",
"Anambra",
"Bauchi",
"Bayelsa",
"Benue",
"Borno",
"Cross River",
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 7, 2024 22:42
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@ttyler01
ttyler01 / Speedify-Setup.md
Last active May 7, 2024 22:40
These are the things I did to configure Speedify on my Raspberry Pi to bond 3 DSL modems for my house

Intro

Note: Verizon enabled LTE Home Internet in our area a while back and we switched immediately. The below setup was fun and instructive however we wasted no time dumping DSL. The whole-home VPN this provided - which you could still easily set up without all the multiplexing - was great but there were constant issues with streaming services trying to prevent revenue leakage.

I live in a semi-rural area and we have crap internet options. The ONLY wired service to my house is ATT DSL. In 2020 some of the neighbors convinced ATT to sell us business accounts, which allows us to have more than 1 DSL line to the house (we got 3). Rather than run multiple WiFi networks - one for each DSL modem - at my house I wanted to bond the lines and aggregate the bandwidth. ATT won't do this for you, even though the DSL modems support it.