Skip to content

Instantly share code, notes, and snippets.

View mcandre's full-sized avatar

Andrew mcandre

  • Milwaukee, WI
View GitHub Profile
@mcandre
mcandre / half_adder.sv
Created September 28, 2021 01:43
half_adder SystemVerilog
module half_adder(
input clk,
a,
b,
output reg sum,
carry
);
always @(posedge clk)
begin
sum <= a ^ b;
@mcandre
mcandre / cmake.log
Last active September 24, 2021 18:41
cmake build error log
$ conan install -s compiler.cppstd=17 -s compiler=clang -s compiler.version=7.0 --build missing .
Configuration:
[settings]
arch=armv7
arch_build=armv7
build_type=Release
compiler=clang
compiler.cppstd=17
@mcandre
mcandre / show-binary-dependencies.md
Last active April 26, 2021 02:50
Show Dependencies

General UNIX/Linux

$ ldd <binary>

macOS

$ otool -L 
@mcandre
mcandre / windows-install-msvc-and-clang.md
Last active May 1, 2021 02:22
Windows Install MSVC and clang

Windows Install MSVC and clang

  1. Install Chocolatey.
  2. Launch a PowerShell terminal in administrator mode.
  3. Install visualstudio2019community.
  4. Install the Visual Studio 2019 native C++ Desktop workload with the optional MSVC and clang components included:
PS C:\> choco install --force visualstudio2019-workload-nativedesktop --package-parameters "--includeOptional"
@mcandre
mcandre / mac-enable-libfuzzer.md
Created March 19, 2021 18:17
macOS Enable libFuzzer
  1. Run brew install llvm --HEAD.
  2. Update certain shell variables:
# Prefer newer LLVM with fuzzing enabled
# shellcheck source=/dev/null
export CC='clang'
export CXX='clang++'
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
PATH="$(brew --prefix)/opt/llvm/bin:$PATH"
@mcandre
mcandre / build.log
Created December 8, 2020 23:28
zig build log
$ cat src/zag/main.zig
const std = @import("std");
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
//
// The OK triples from:
// https://github.com/ziglang/zig-bootstrap#supported-triples
//
@mcandre
mcandre / diskutility-unborking.md
Created October 11, 2020 15:37
DiskUtility Unborking

If DiskUtility is giving you lip, select View -&gt; Show All Devices and erase the outer device.

@mcandre
mcandre / unpacker.rb
Created September 12, 2020 15:46
bit manip
#!/usr/bin/env ruby
file = File.new('/tmp/default.pcm.dat', 'rb')
while bytes = file.read(4) do
puts bytes.unpack('l>')[0]
end
@mcandre
mcandre / davinci-resolve-fix-paste.md
Created August 22, 2020 21:33
DaVinci Resolve Fix Paste

If pasting clips are appearing before the beginning of the track, then clear all in and out marks.

@mcandre
mcandre / vscode-fix-paste-indentation.md
Created July 28, 2020 17:50
VSCode: Fix Paste Indentation

VSCode has a nasty habit of nesting pasted text deeper than it should be. To stop this from happening, configure:

{
    "editor.autoindent": "advanced"
}