Skip to content

Instantly share code, notes, and snippets.

@endzyme
endzyme / rake_semaphore.rb
Last active March 31, 2016 04:06
very hacky rake semaphore to enable multithreading data migrations in rake tasks
namespace :semaphore do
desc "Basic Semaphore Task"
task :my_task_name => :environment do
# Build list of running threads
@threads = []
@max_threads = 3
# Setup Rails Config to allow concurrency (prelaoding env for models)
Rails.configuration.threadsafe!
Rails.configuration.dependency_loading = true
@endzyme
endzyme / iam_to_tf_policy_toc.py
Created July 11, 2017 15:54
iam to terraform policy document converter
#!/usr/bin/env python3
import json,sys
json_files = sys.argv[1:]
if len(json_files) < 1:
print("Usage: <script>.py <jsonfile1> <jsonfile2>...")
exit(1)
for json_file in json_files:
@endzyme
endzyme / expected input
Created August 25, 2017 19:41
gross firehose importer for terraform
[
{
"DeliveryStreamDescription": {
"HasMoreDestinations": false,
"VersionId": "1",
"CreateTimestamp": 12345678.047,
"DeliveryStreamARN": "arn:aws:firehose:us-east-1:1234567:deliverystream/some_name",
"DeliveryStreamStatus": "ACTIVE",
"DeliveryStreamName": "some_name",
"Destinations": [

Keybase proof

I hereby claim:

  • I am endzyme on github.
  • I am nickhuanca (https://keybase.io/nickhuanca) on keybase.
  • I have a public key ASB1ieqGkiWH4joJSuPpWS-kKShDiPvQNRptjxjkUvpZdgo

To claim this, I am signing this object: