Skip to content

Instantly share code, notes, and snippets.

View coolaj86's full-sized avatar
😎
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell

AJ ONeal coolaj86

😎
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell
View GitHub Profile
gobject_submit
::AddGovernanceObject
::Relay (probably what we want)
::NotifyGovernanceObject (optimistic self-notification)
src/governance/object.cpp:
CGovernanceObject::Relay
// "Inventory" Message
// Note: conversion methods are created by macro `SERIALIZE_METHODS`
CInv inv(MSG_GOVERNANCE_OBJECT, GetHash());
"use strict";
// Adapted from
// github.com/dashpay/dash/tree/develop/src/governance/common.cpp
// USAGE
// node ./gobject-hash-debugger.js
const DV_LE = true;
// const DV_BE = false;
@coolaj86
coolaj86 / GlobalMutex.cpp
Last active July 18, 2024 04:47
ChatGippity told me how to do a Global Mutex in C++...
#include "GlobalMutex.h"
std::mutex globalMutex;
@coolaj86
coolaj86 / view-dependent-tables-mysql.sql
Last active December 2, 2023 15:48
How to View Tables that Reference a Target Table in MySQL
-- USAGE
-- call show_references_to('my_much_referenced_table') \G
DELIMITER //
CREATE OR REPLACE PROCEDURE show_references_to(
my_table_name VARCHAR(255)
-- , my_column_name VARCHAR(255)
)
BEGIN
@coolaj86
coolaj86 / posix-bsd-flags.md
Last active October 20, 2023 19:40
POSIX, BSD, GNU, & IEEE Standard Command Line Flags & Options

POSIX & BSD Standard Command Line Flags & Options

The vital resource for developers creating new command-line tools to learn the wisdom of the ancients.

All programs should universally implement these flags:

  • -V (uppercase), --version, version
  • --help, help (also the default if nothing is given)
  • -- stop processing flags; treat all else as raw arguments

I'm creating a backup retention strategy with this directory structure:

backups
├── daily
├── monthly
│  ├── 2019
│  └── 2020
└── weekly

Expected Output

/usr/bin
$HOME/.local/bin
$HOME/.local/a/bin
$HOME/.local/b/bin
$HOME/.local/c/bin
$HOME/.local/d/bin