Skip to content

Instantly share code, notes, and snippets.

@phistrom
phistrom / pull-arch.sh
Created July 2, 2021 17:54
docker pull different architecture image
#!/bin/bash
# Usage: pull-arch.sh IMAGE:TAG ARCHITECTURE
# Example:
# You're on an amd64 system, but you want the ARM version (arm64) of a the
# python:3 image for whatever reason:
# `pull-arch.sh python:3 arm64`
# would pull the arm64 version of the python:3 image from Dockerhub
# and tag it on your machine as python:3-arm64
@phistrom
phistrom / slack-verify.js
Last active September 22, 2023 19:34
Function to verify X-Slack-Signature header in a Cloudflare Worker
/* global SLACK_SIGNING_SECRET */
const SIGN_VERSION = 'v0' // per documentation, this is always "v0"
/**
* Verify that a request actually came from Slack using our Signing Secret
* and HMAC-SHA256.
*
* Based on code examples found in Cloudflare's documentation:
* https://developers.cloudflare.com/workers/examples/signing-requests