Skip to content

Instantly share code, notes, and snippets.

View bsacheri's full-sized avatar

Ben bsacheri

  • Pittsburgh, PA
View GitHub Profile
@Hugoberry
Hugoberry / CRC32.m
Last active January 30, 2024 22:33
CRC32 implementation in Power Query M mostly inpired by the article about CRC32 computation http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html and Bit Hacks https://graphics.stanford.edu/~seander/bithacks.htm
(StringInput)=>
let
/*function for reversing the bits in a 8-bit number*/
reverse = (x) =>
Number.Mod(Number.BitwiseAnd((x* 0x0202020202),0x010884422010),1023),
/*function for reversing the bits in a 32-bit number*/
reverse32 = (x) =>
let
b0 = Number.BitwiseAnd(x,0xff),
@steve-jansen
steve-jansen / ExportVisualBasicCode.bas.vb
Created November 21, 2013 20:56
Excel macro to export all VBA source code in this project to text files for proper source control versioning
' Excel macro to export all VBA source code in this project to text files for proper source control versioning
' Requires enabling the Excel setting in Options/Trust Center/Trust Center Settings/Macro Settings/Trust access to the VBA project object model
Public Sub ExportVisualBasicCode()
Const Module = 1
Const ClassModule = 2
Const Form = 3
Const Document = 100
Const Padding = 24
Dim VBComponent As Object