Skip to content

Instantly share code, notes, and snippets.

View InBrewJ's full-sized avatar
🐼
eyes

Jason Brewer InBrewJ

🐼
eyes
View GitHub Profile
@edonosotti
edonosotti / terraform_aws_api_gateway_account_cloudwatch.tf
Created May 10, 2019 17:16
Terraform plan to grant API Gateway permissions to write logs to CloudWatch in AWS
# NOT MY CODE! TAKEN FROM THE OFFICIAL DOCS:
# https://www.terraform.io/docs/providers/aws/r/api_gateway_account.html
# and saved here as a backup.
resource "aws_api_gateway_account" "demo" {
cloudwatch_role_arn = "${aws_iam_role.cloudwatch.arn}"
}
resource "aws_iam_role" "cloudwatch" {
name = "api_gateway_cloudwatch_global"
@ToxicBakery
ToxicBakery / CircularArray.kt
Last active February 27, 2024 00:46
Simple circular/ring buffer style implementation backed by an array for kotlin with test coverage
import java.util.concurrent.atomic.AtomicInteger
class CircularArray<T> : Iterable<T>, Cloneable {
/**
* Creates a new instance of the array with the given size.
*/
constructor(bufferSize: Int) {
this.arr = arrayOfNulls(bufferSize)
this.tail = -1