Skip to content

Instantly share code, notes, and snippets.

@pragmat1c
pragmat1c / delete-slack-messages.js
Created April 1, 2019 15:40
Bulk delete a bunch of slack messages. Funny story: Someone put something on my desk and somehow it landed just right and the + and enter key were held down and I created a bunch of messages in a slack channel. Rather than deleting one by one, I found this script. I forget where I got out, otherwise I'd give proper credit. However it works (it's…
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = ''; // You can learn it from: https://api.slack.com/custom-integrations/legacy-tokens
// GLOBALS #############################################################################################################
@pragmat1c
pragmat1c / gist:125cdb06e56a7e8d790f070121d775bf
Created April 4, 2019 18:31
Prune local git branches that don't have a remote branch. I use this to clean up the branches I've committed and merged every so often.
#In your .gitconfig
[alias]
prune-branches = !git remote prune origin && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -D
@pragmat1c
pragmat1c / fullstory.d.ts
Last active August 24, 2022 17:36 — forked from ofer-papaya/fullstory.d.ts
Fullstory API typescript definitions
interface Fullstory {
identify(uid: string, userVars?: object): void;
setUserVars(userVars: object): void;
getCurrentSessionURL(now?: boolean): string;
log(msg: string): void;
log(level: string, msg: string): void;
shutdown(): void;
restart(): void;
consent(consent: boolean): void;
event(eventName: string, eventProperties: object): void;
@pragmat1c
pragmat1c / Install-Terminal.ps1
Created July 15, 2025 00:48
Install Terminal and WinGet on Windows Server 2022
# Works as of 2025-07-14
# Download prerequisites
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile $env:USERPROFILE\Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage $env:USERPROFILE\Microsoft.VCLibs.x64.14.00.Desktop.appx
# Download the ZIP file
Invoke-WebRequest -Uri "https://github.com/microsoft/terminal/releases/download/v1.22.11751.0/Microsoft.WindowsTerminal_1.22.11751.0_8wekyb3d8bbwe.msixbundle_Windows10_PreinstallKit.zip" -OutFile "$env:USERPROFILE\Downloads\WindowsTerminal_PreinstallKit.zip"
# Unzip the file
Expand-Archive -Path "$env:USERPROFILE\Downloads\WindowsTerminal_PreinstallKit.zip" -DestinationPath "$env:USERPROFILE\Downloads\WindowsTerminal_PreinstallKit"