Skip to content

Instantly share code, notes, and snippets.

#!/bin/env rdmd
module xorg_show_grabs;
import std.algorithm;
import std.conv;
import std.exception;
import std.getopt;
import std.stdio;
import std.string;
@jcubic
jcubic / cdn.md
Last active May 8, 2024 15:04
How to setup a literally free CDN
@wojteklu
wojteklu / clean_code.md
Last active May 8, 2024 15:01
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

Alpine.directive('typed', (el, { expression, modifiers }, { evaluateLater, effect, cleanup }) => {
const getStrings = evaluateLater(expression);
const modifierValue = (key, fallback) => {
if (-1 === modifiers.indexOf(key)) {
return fallback;
}
const value = modifiers[modifiers.indexOf(key) + 1];
@Joao-Peterson
Joao-Peterson / gmk67-manual.md
Last active May 8, 2024 14:59
GMK67 manual (English)
@swarad07
swarad07 / detect-position-sticky.html
Created September 19, 2020 15:16
detect-position-sticky
<!-- HTML -->
<div id="nav-container">This will get unsticky scroll </div>
<div id="nav-container-bottom"></div>
<!-- CSS -->
// 1px tracker.
#nav-container-bottom {
min-height: 1px;
min-width: 1px;
}
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 8, 2024 14:58
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@Neo23x0
Neo23x0 / sigma-evtx-scan.md
Last active May 8, 2024 14:57
Guide to Use Sigma EVTX Checker

Guide to Use Nextron's Sigma EVTX Checker

It's a fast go-based scanner for Linux, Windows, and macOS that applies Sigma rules and outputs the matches as JSON.

Clone the Sigma Repository and cd into it

git clone https://github.com/SigmaHQ/sigma.git
cd sigma
@danielrbradley
danielrbradley / IsinValidation.fs
Created December 6, 2016 16:33
Validate an ISIN (International Securities Identification Number) in F#
module Isin
open System.Text.RegularExpressions
// See: http://en.wikipedia.org/wiki/International_Securities_Identification_Number
[<Literal>]
let private AsciiZero = 48
[<Literal>]
let private AsciiNine = 57
@sshymko
sshymko / redis.service
Last active May 8, 2024 14:56
Redis service for systemd on Linux
[Unit]
Description=Redis persistent key-value storage
After=network.target
[Service]
Type=notify
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd --daemonize no
ExecStop=/usr/bin/redis-cli -p 6379 shutdown
ExecReload=/bin/kill -USR2 $MAINPID
Restart=always