Skip to content

Instantly share code, notes, and snippets.

@maxtruxa
maxtruxa / Antonyms.md
Last active May 9, 2024 20:14
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@wojteklu
wojteklu / clean_code.md
Last active May 9, 2024 20:13
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

@notnotrobby
notnotrobby / cgp.md
Last active May 9, 2024 20:12
List of free resources to study computer graphics programming.
@Lars418
Lars418 / gist:53f10b2fc9e488eb038cd3382b5e774d
Created August 18, 2021 18:00
Alle Bilder von einer Anzeige von ebay-kleinanzeigen herunterladen
/**
* HOWTO: Copy whole file, open devtools on page (F12 / Ctrl + Shift + i) and paste it into the console
* Chrome might ask you to allow downloading multiple images.
*/
// credits for forceDownload: https://stackoverflow.com/a/49886131/8463645
function forceDownload(url, fileName){
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "blob";
@Paraphraser
Paraphraser / MQTT_Node-Red_Influx.md
Last active May 9, 2024 20:11
Efficient recipe for getting MQTT data into an InfluxDB database using Node-Red

Recipe: from MQTT to InfluxDB via Node-Red

  • 2023-12-02 revise graphics to correspond with InfluxDB-in node, and explain the pros and cons of InfluxDB 1.8 vs InfluxDB 2.

Introduction

Getting data produced by IoT sensors into a database is practically a mandatory step before effective visualisation (eg dashboards).

This recipe shows you how to get an MQTT payload into an InfluxDB database using three Node-Red nodes. It makes the following assumptions:

@rma92
rma92 / harden.md
Last active May 9, 2024 20:11
Unifi controller on OpenBSD using Ports

Attempt at a hardened one on OpenBSD on Vultr

  • Upload install.iso for OpenBSD to Vultr, create a new VM using the ISO. You need the ISO to create full disk encryption. Also this eliminates any potential security issues cloud-init can cause.
  • Set a full disk encryption key, set a root password that is strong, set a user that doesn't match anyone's name with a good password.
  • Start sshd by default, don't allow root logins.
  • Install the entire system to a single / partition (for disk usage reasons)

Each time the VM boots, someone will need to manually enter the encryption key at the prompt.

Initial setup: enable doas, change SSH port, pubkey auth only

Enable doas

@jnwhiteh
jnwhiteh / install-ljitrocks.sh
Created August 4, 2011 14:49
Install luajit+luarocks in sandboxed environment
#!/usr/bin/env bash
set -e
die() {
echo "$1";
exit 1;
}
# Fetch and install LuaJIT/LuaRocks into the local directory
@truebit
truebit / init.lua
Last active May 9, 2024 20:08
Kitty Terminal: pull down from top like iTerm2
local spaces = require("hs.spaces") -- https://github.com/asmagill/hs._asm.spaces
-- Switch kitty
hs.hotkey.bind({'command'}, 'escape', function () -- change your own hotkey combo here, available keys could be found here:https://www.hammerspoon.org/docs/hs.hotkey.html#bind
local BUNDLE_ID = 'net.kovidgoyal.kitty' -- more accurate to avoid mismatching on browser titles
function getMainWindow(app)
-- get main window from app
local win = nil
while win == nil do
@rkitover
rkitover / load-visual-studio-environment.sh
Last active May 9, 2024 20:08
Load Visual Studio environment in MSYS2.
# Visual Studio Environemnt Loader
#
# For MSYS2/Cygwin/etc..
#
# Set the following in your ~/.bashrc:
#
# ENVIRONMENT CONFIGURATION:
#
# To enable static linking where possible:
#
@SJ-James
SJ-James / etModules-icon-codes.css
Created March 21, 2018 21:33
A list of the codes for Divi's built in icon collection
/* example of use */
h1:before {
font-family: 'etModules';
content: "\24";
}
/* codes */
.arrow_up:before {
content: "\21";