Skip to content

Instantly share code, notes, and snippets.

@klaasnotfound
klaasnotfound / jekyll-multiple-languages-plugin.rb
Last active May 27, 2019 09:40
This is a modified version of the most popular Jekyll i18n plugin. It puts the default language in its own subfolder (like the other languages), uses a base.html file as the central index.html (for language-based redirects) and properly translates custom collection documents and links.
=begin
Jekyll Multiple Languages is an internationalization plugin for Jekyll. It
compiles your Jekyll site for one or more languages with a similar approach as
Rails does. The different sites will be stored in sub folders with the same name
as the language it contains.
Please visit https://github.com/screeninteraction/jekyll-multiple-languages-plugin
for more details.
@liorazi
liorazi / Font+MonospacedDigits.swift
Last active November 23, 2024 13:14
Font Extension for Monospaced Digits (Swift 4.0)
import UIKit
extension UIFont {
/// Returns a font with monospaced digits, preserving other font attributes.
var withMonospacedDigits: UIFont {
let monospacedDescriptor = fontDescriptor.withMonospacedDigits
return UIFont(descriptor: monospacedDescriptor, size: 0) // Size 0 preserves the original font size.
}
}
@artizirk
artizirk / debug.md
Last active November 29, 2024 00:21
Debug WireGuard Linux kernel module
@gene1wood
gene1wood / postfix-debconf-get-selections.txt
Last active April 15, 2021 07:09
postfix debconf-get-selections using myhost.example.com as an example domain name
# Internet protocols to use:
# Choices: all, ipv6, ipv4
postfix postfix/protocols select all
# System mail name:
postfix postfix/mailname string myhost.example.com
# Add a 'mydomain' entry in main.cf for upgrade?
postfix postfix/mydomain_warning boolean
# Correct tlsmgr entry in master.cf for upgrade?
postfix postfix/tlsmgr_upgrade_warning boolean
# Root and postmaster mail recipient:
@usmcfiredog
usmcfiredog / ulagen.py
Created March 20, 2021 05:34
IPv6 ULA Generation for VPN server
#!/usr/bin/env python3
import hashlib
import time
import uuid
def get_eui64():
mac = uuid.getnode()
eui64 = mac >> 24 << 48 | 0xfffe000000 | mac & 0xffffff
eui64_canon = "-".join([format(eui64, "02X")[i:i+2] for i in range(0, 18, 2)])