Skip to content

Instantly share code, notes, and snippets.

@jbboynton
jbboynton / slack-files-downloader.sh
Created August 6, 2025 03:46 — forked from v01pe/slack-files-downloader.sh
Download all files from a Slack workspace export folder.
#!/bin/bash
#
# This script will browse a Slack export folder and download all files in a new /export folder
#
# HOW TO:
# 1. As a Workspace admin, download an export of your Slack history (https://www.slack.com/services/export)
# 2. Make sure you have jq installed (https://stedolan.github.io/jq/)
# 3. Place this file at the root of your Slack export folder, next to channels.json
# 4. Run `bash slack-files-downloader.sh` in your terminal
#
#!/bin/bash
# Builds the specified version of Ruby from source.
set -eo pipefail
version="$1"
build_directory="/opt/ruby/$version"
source_url="https://cache.ruby-lang.org/pub/ruby/${version%??}/ruby-$version.tar.gz"
@jbboynton
jbboynton / pre-commit
Last active August 6, 2020 05:05
A pre-commit Git hook for cleaning up staged files.
#!/bin/bash
set -e
theme_base="example_theme_directory"
IFS=$'\n'
# Perform case-insensitive comparisons
shopt -s nocasematch
@jbboynton
jbboynton / bucket_policy.json
Created December 2, 2019 18:14
AWS S3 and IAM policies for S3-Uploads
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<AWS account ID>:root",
"arn:aws:iam::<AWS account ID>:user/<bucket-specific user's ID>"
]
@jbboynton
jbboynton / .vimrc
Last active August 27, 2019 05:46
Generate HTML version of notes written in Markdown when the file is written.
function! g:RunSilentCommand(cmd)
:execute ':silent !' . a:cmd
:execute ':redraw!'
:echom 'Executed ' . a:cmd . '.'
endfunction
command! -nargs=1 Silent call g:RunSilentCommand(<q-args>)
augroup saveNotes
autocmd!
@jbboynton
jbboynton / TerminalVim.scpt
Last active February 25, 2018 01:20 — forked from charlietran/TerminalVim.scpt
AppleScript to open a file in vim and iTerm2 on macOS High Sierra
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default