Skip to content

Instantly share code, notes, and snippets.

View ryangraham's full-sized avatar
😝

Ryan Graham ryangraham

😝
View GitHub Profile
@brettfreer
brettfreer / dynamodb_purge_table.py
Created July 6, 2016 10:36
Purge all items from an AWS dynamodb table with an exponential timing back-off
#!/usr/bin/env python3
""" Purge all items from an AWS dynamodb table with an exponential timing back-off
"""
import logging
from time import sleep
import boto3
from botocore.exceptions import ClientError
@alisinabh
alisinabh / bitconverter_sample.ex
Last active February 16, 2023 22:16
Elixir convert binary (byte array) to signed Int32 with pattern matching and vice versa [DEPRECARED - just use whats inside the functions]
defmodule ZigorProxy.BitConverter do
@moduledoc """
This module handles standard binary operations.
Converting binaries to and from general data types.
"""
require Logger
@doc """
Converts binary of 4 bytes into an signed integer.
@blackode
blackode / nested_maps.md
Last active March 10, 2020 20:48
Nested Maps in Elixir

#Get a value from nested maps

The get_in function can be used to retrieve a nested value in nested maps using a list of keys.

nested_map = %{ name: %{ first_name: "blackode"} }     #Example of Nested Map
first_name = get_in(nested_map, [:name, :first_name])  # Retrieving the Key

# Returns nil for missing value 
nil = get_in(nested, [:name, :last_name])              # returns nil when key is not present
@joelthompson
joelthompson / README.md
Last active May 13, 2025 14:31
Vault Auth
@maiconbaum
maiconbaum / aws_athena_query.sql
Created December 28, 2022 22:03
AWS Glue Catalog Table for AWS VPC Flow Logs using Apache Hive Compatible Format and Partition Projection.
CREATE EXTERNAL TABLE IF NOT EXISTS aws_vpc_flow_logs (
`version` int,
`account_id` string,
`interface_id` string,
`srcaddr` string,
`dstaddr` string,
`srcport` int,
`dstport` int,
`protocol` bigint,
`packets` bigint,