Skip to content

Instantly share code, notes, and snippets.

View boilemmashem's full-sized avatar

Mike Hart boilemmashem

  • 13:38 (UTC)
View GitHub Profile
@boilemmashem
boilemmashem / AlternateDataStreams.md
Created July 22, 2024 14:31 — forked from chriselgee/AlternateDataStreams.md
Finding and reading alternate data streams (ADS) with PowerShell on an NTFS partition

To find all streams within file.txt: Get-Item .\file.txt -Stream *

PSPath        : Microsoft.PowerShell.Core\FileSystem::C:\file.txt::$DATA
PSParentPath  : Microsoft.PowerShell.Core\FileSystem::C:\
PSChildName   : file.txt::$DATA
PSDrive       : C
PSProvider    : Microsoft.PowerShell.Core\FileSystem
PSIsContainer : False
FileName : C:\file.txt
@boilemmashem
boilemmashem / uses.md
Last active March 5, 2025 14:56
Uses

Stuff I use

Hey there! Seems like you found me. Perhaps you came from uses? This is my stuff.

Hardware

  • Macbook Pro 2021
  • Windows PC
    • Core: AMD
  • GPU: NVIDIA 3600ti
@boilemmashem
boilemmashem / timed.ts
Last active January 12, 2024 11:50
Time a function decorator
/**
* Decorates a function so that it console logs how long it takes to run.
* @example
* // import {timed}
* let functionToTime = () => {...does something}
* functionToTime = timed(functionToTime)
* functionToTime() // use as normal
* @param func
* @returns
*/
@boilemmashem
boilemmashem / addDaysToDate.ts
Last active December 22, 2023 11:10
Add days to date
/**
* Add days to given Date
* @param {Date}
* @param {number}
* @returns {Date}
*
* @example
* addDaysToDate(new Date(), 7) // date for 7 days from now
*/
export const addDaysToDate = (date: Date, days: number): Date => {
@boilemmashem
boilemmashem / getMaxContrast.js
Last active December 22, 2023 11:11
Black/White maximum contrast detection
/**
* Return black or white, whichever has higher contrast given the input color.
*
* @param {string} n - Input hexcolor without #
* @return {string} – white or black hex value with #
*
* @example
*
* getMaxContrast('FFFFFF') // #000000
*/