This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Export Zubax Forum threads (Discourse) to local Markdown with attachments. This is designed to make forum thread | |
| contents easily available to AI agents, especially when referenced threads contain design specifications. | |
| FEATURES | |
| - Fetch root topic and recursively fetch internally linked topics. | |
| - Supports private topics using ZUBAX_FORUM_API_KEY or ZUBAX_FORUM_API_TOKEN (+ username). | |
| - Downloads attachment assets and rewrites references to local files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # | |
| # A simple CLI utility that accepts natural-language description of what needs to be done and provides a Python | |
| # script doing just that, with an option to run it immediately. The tool requires no dependencies and runs anywhere. | |
| # | |
| # 1shot.py find the largest file in this directory excluding hidden directories | |
| # 1shot.py count lines of Python code excluding blanks and comments, show top 10 | |
| # | |
| # Quotes are not necessary, just write the prompt like you normally would. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Zed settings | |
| // | |
| // For information on how to configure Zed, see the Zed | |
| // documentation: https://zed.dev/docs/configuring-zed | |
| // | |
| // To see all of Zed's default settings without changing your | |
| // custom settings, run `zed: open default settings` from the | |
| // command palette (cmd-shift-p / ctrl-shift-p) | |
| { | |
| "session": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local wezterm = require 'wezterm' | |
| local act = wezterm.action | |
| -- https://wezterm.org/config/lua/config/ | |
| return { | |
| font = wezterm.font("MesloLGS NF"), | |
| font_size = 10, | |
| color_scheme = "deep", | |
| colors = { | |
| background = "black", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// ____ ______ __ __ | |
| /// / __ `____ ___ ____ / ____/_ ______ / /_ ____ / / | |
| /// / / / / __ `/ _ `/ __ `/ / / / / / __ `/ __ `/ __ `/ / | |
| /// / /_/ / /_/ / __/ / / / /___/ /_/ / /_/ / / / / /_/ / / | |
| /// `____/ .___/`___/_/ /_/`____/`__, / .___/_/ /_/`__,_/_/ | |
| /// /_/ /____/_/ | |
| /// | |
| /// A header-only implementation of a fairly standard O(1) free-list block pool allocator. | |
| /// Consider also O1Heap (https://github.com/pavel-kirienko/o1heap) if a more conventional heap is required. | |
| /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stddef.h> | |
| #include <stdint.h> | |
| #define CRC_INITIAL 0xFFFFFFFFUL | |
| #define CRC_OUTPUT_XOR 0xFFFFFFFFUL | |
| #define CRC_RESIDUE_BEFORE_OUTPUT_XOR 0xB798B438UL | |
| #define CRC_RESIDUE_AFTER_OUTPUT_XOR (CRC_RESIDUE_BEFORE_OUTPUT_XOR ^ CRC_OUTPUT_XOR) | |
| #define CRC_SIZE_BYTES 4U | |
| static const uint32_t crc_table[256] = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Stateless, purely combinational sin(x) look-up table. Can be used as the phase-to-amplitude converter of an NCO. | |
| /// It stores 256 9-bit items in a look-up table representing the first quarter of the wave. | |
| /// The input x is expected to be normalized into [0, 1024) that maps to [0, 2 pi). | |
| /// The signed output is normalized into [-511, +511] (sic! -512 not used). | |
| module sine_lookup_1024( | |
| input wire [9:0] x, | |
| output wire signed [9:0] out | |
| ); | |
| reg [8:0] entry; // Not an actual register, just a wire assignable from the always block. | |
| assign out = x[9] ? -$signed({1'b0, entry}) : $signed({1'b0, entry}); // The MSb represents the half-wave index. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// A numerically controlled oscillator (NCO) that outputs a sawtooth wave, whose frequency is a function of | |
| /// clk rate and frequency_control_word, and the amplitude spans the range [0, 2**OUTPUT_WIDTH). | |
| /// The output frequency is defined as: | |
| /// | |
| /// f_out = (f_clk * frequency_control_word) / (2**PHASE_ACCUMULATOR_WIDTH) | |
| /// | |
| /// Solve for frequency_control_word: | |
| /// | |
| /// frequency_control_word = ((2**PHASE_ACCUMULATOR_WIDTH) * f_out) / f_clk | |
| /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cassert> | |
| #include <cstdint> | |
| #include <cstdlib> | |
| namespace stack_canary | |
| { | |
| /// Do not use this directly; see the StackCanary definition below. | |
| template <std::size_t n_bytes, std::uint8_t seed = 0xC9> | |
| class StackCanary_Impl final |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script will disable most of the Windows security-related features. | |
| # It is mostly intended for use in disposable VMs, such as simulation and CI/CD runners. | |
| # Read the source to see what exactly is done. | |
| # Author: Pavel Kirienko <pavel.kirienko@zubax.com> | |
| # Relaunch elevated if needed | |
| $IsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent() | |
| ).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) | |
| if (-not $IsAdmin) { |
NewerOlder