Skip to content

Instantly share code, notes, and snippets.

View w0rd-driven's full-sized avatar
🌴
Chill

Jeremy Brayton w0rd-driven

🌴
Chill
View GitHub Profile
@w0rd-driven
w0rd-driven / shopify-cdn-spaces.js
Created June 28, 2023 19:28
K6 S3 test for Digital Ocean Spaces
import exec from 'k6/execution';
import http from 'k6/http';
import { AWSError, AWSConfig, SignatureV4, S3Client } from 'https://jslib.k6.io/aws/0.8.0/aws.js'
const bucketName = 'orange-cdn-west';
export const options = {
ext: {
loadimpact: {
@w0rd-driven
w0rd-driven / passwords.txt
Created November 18, 2016 20:19
BFG Repo-Cleaner --replace-text example
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default)
PASSWORD2==>examplePass # replace with 'examplePass' instead
PASSWORD3==> # replace with the empty string
regex:password=\w+==>password= # Replace, using a regex
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines
@w0rd-driven
w0rd-driven / stream_distribute.ex
Created May 4, 2024 00:02 — forked from zachdaniel/stream_distribute.ex
A small demo to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`. Open in Livebook: https://livebook.dev/run?url=https%3A%2F%2Fgist.github.com%2Fzachdaniel%2Fd5ab06a9d2362fceeb6d27c37b206e28
<!-- livebook:{"persist_outputs":true} -->
# Distribute
## Section
A small toy to show how you might, given a stream, do a "fan out", processing different elements in separate streams. Powered by simple primitives like `Stream.resource` and `spawn_link`.
```elixir
defmodule Distribute do
@w0rd-driven
w0rd-driven / operations_test.exs
Created May 11, 2024 22:44 — forked from doorgan/operations_test.exs
Testing module macros
defmodule OperationsTest do
use ExUnit.Case, async: true
def make_mod() do
String.to_atom("Elixir.Test#{System.unique_integer([:positive])}")
end
describe "operation/2" do
setup do
mod = make_mod()