Skip to content

Instantly share code, notes, and snippets.

@RafPe
RafPe / New-nLogLogger.ps1
Last active March 28, 2025 19:40
Nlog logging with PowerShell
$dllBytes = [System.IO.File]::ReadAllBytes( "C:\NLog.dll")
[System.Reflection.Assembly]::Load($dllBytes)
# Create object that we will use to send customized info
# This is to be used if you use ${event-context:item=MyValue} in your config !
$cos = new-object NLog.LogEventInfo
$cos.Level = [NLog.LogLevel]::Info
$cos.Message = 'executing something really cool'
# Load XML configuration and use it
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active March 28, 2025 19:37
crack activate Office on mac with license file
@rvrsh3ll
rvrsh3ll / windows-keys.md
Created February 18, 2024 22:44
Windows Product Keys

NOTE

These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.

Index

@Ellivers
Ellivers / mcfunction-precompilers.md
Last active March 28, 2025 19:34
Minecraft function precompilers

Minecraft function precompilers

An attempt to make a definitive list of all (at least somewhat finished) projects that compile to MCFunction (Minecraft function) code for Minecraft: Java Edition. Each category is very roughly ordered from most to least usable/well-known. Categories and notes in parentheses may not be entirely accurate.

Modern

@eykd
eykd / esv_ranges.py
Created February 24, 2011 14:14
Data structure defining the number of verses in every chapter of every book of the ESV bible.
# list of books, padded with None to be 1-indexed
# each book is a tuple with name of book, # of chapters, [number of verses in each chapter]
# the list with the number of verses per chapter is padded to make it 1-indexed
passage_data = [None,
('Genesis', 50, [None, 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35,
46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26]),
('Exodus', 40, [None, 22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21,
43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38]),
('Leviticus', 27, [None, 17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34]),
('Numbers', 36, [None, 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65,
export const requireComment = {
meta: {
type: "suggestion",
docs: {
description: "useEffectにはコメントでの説明が必須です。",
},
schema: [],
messages: {
requireCommentOnUseEffect: `useEffectにはコメントでの説明が必須です。
// color1 and color2 are R4G4B4 12bit RGB color values, alpha is 0-255
uint16_t blend_12bit( uint16_t color1, uint16_t color2, uint8_t alpha ) {
uint64_t c1 = (uint64_t) color1;
uint64_t c2 = (uint64_t) color2;
uint64_t a = (uint64_t)( alpha >> 4 );
// bit magic to alpha blend R G B with single mul
c1 = ( c1 | ( c1 << 12 ) ) & 0x0f0f0f;
c2 = ( c2 | ( c2 << 12 ) ) & 0x0f0f0f;
uint32_t o = ( ( ( ( c2 - c1 ) * a ) >> 4 ) + c1 ) & 0x0f0f0f;
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 28, 2025 19:30
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@dydemin
dydemin / sign.py
Last active March 28, 2025 19:27
libkalkancrypt: SignWSSE на Python
import ctypes
KEY_ALIAS = ""
KC_RESULT_OK = 0x0
KC_STORE_FILE_SYSTEM = 0x1
kalkan = ctypes.CDLL("/usr/lib/libkalkancryptwr-64.so", mode=1)
kalkan.KC_GetLastError = kalkan.KC_GetLastError
kalkan.KC_GetLastError.restype = ctypes.c_ulong
#!/bin/bash
delete-vpc() {
local teamName=${1:-myteam}
local region=${2:-us-east-1}
aws ec2 describe-vpcs --region ${region} | jq -r ".Vpcs[] | select(.Tags[].Value | contains(\"${teamName}\")) | .VpcId" 2>/dev/null |
while read vpcID; do
echo "# deleting vpc (${vpcID}) ..."