Skip to content

Instantly share code, notes, and snippets.

View ivuorinen's full-sized avatar

Ismo Vuorinen ivuorinen

View GitHub Profile
@ttscoff
ttscoff / dontforget.bash
Last active August 11, 2024 20:05
Quick reminders from Terminal (bash)
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
#
@wojteklu
wojteklu / clean_code.md
Last active May 21, 2025 16:12
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

@alpody
alpody / gist:27690be5312e589e3d2d561020de6667
Last active May 27, 2023 13:03
export all keybindings in vim to file
"verbose show file which produce remap keybinding
:redir! > vim_keys.txt
:silent verbose map
:redir END
@jsit
jsit / pinboard-bookmarklet.js
Last active October 9, 2024 14:16
Pinboard Bookmarklet -- Use text selection for description if available, otherwise use meta description, and include referrer in description if exists.
javascript: q = location.href;
q = q.replace(/[?&]utm_[^&]*/g, "");
q = q.replace(/[?&]mc_[^&]*/g, "");
q = q.replace(/[?&]src=[^&]*/g, "");
q = q.replace(/[?&]ref=[^&]*/g, "");
desc = "";
if (document.getElementsByName("description").length > 0) {
desc = document.getElementsByName("description")[0].getAttribute("content")
"\n\n"
} else if (document.getElementsByName("Description").length > 0) {
@saniaky
saniaky / Readme.md
Last active April 29, 2025 21:46
Docker + nginx-proxy + let's encrypt + watchtower + fail2ban

Complete solution for websites hosting

This gist contains example of how you can configure nginx reverse-proxy with autmatic container discovery, SSL certificates generation (using Let's Encrypt) and auto updates.

Features:

  • Automatically detect new containers and reconfigure nginx reverse-proxy
  • Automatically generate/update SSL certificates for all specified containers.
  • Watch for new docker images and update them.
  • Ban bots and hackers who are trying to bruteforce your website or do anything suspicious.
@katef
katef / plot.awk
Last active November 20, 2024 23:27
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@davidteren
davidteren / nerd_fonts.md
Last active May 10, 2025 11:30
Install Nerd Fonts via Homebrew [updated & fixed]
@k1sul1
k1sul1 / class.vite.php
Created June 8, 2022 11:44
"Basic" Vite & WP theme setup
<?php
namespace k1;
class ViteAsset {
public $file = null;
public $src = null;
public $isEntry = false;
public $isDynamicEntry = false;
system.activationScripts.applications.text = let
env = pkgs.buildEnv {
name = "system-applications";
paths = config.environment.systemPackages;
pathsToLink = "/Applications";
};
in
pkgs.lib.mkForce ''
# Set up applications.
echo "setting up /Applications..." >&2