Skip to content

Instantly share code, notes, and snippets.

View calvernaz's full-sized avatar

Cesar Alvernaz calvernaz

View GitHub Profile
# http -v POST \
# https://MY_API_GATEWAY_ID.execute-api.MY_REGION.amazonaws.com/v0/lambda
AWSTemplateFormatVersion: "2010-09-09"
Description: AWS API Gateway with a Lambda Integration
Resources:
ApiGatewayRestApi:
Type: AWS::ApiGatewayV2::Api
@calvernaz
calvernaz / yaml
Created March 28, 2022 21:48
openapi
openapi: "3.0.1"
info:
title: "base64-cesar"
version: "2022-03-17 09:06:51UTC"
servers:
- url: "https://2vwcgj5k67.execute-api.eu-west-1.amazonaws.com/{basePath}"
variables:
basePath:
default: ""
paths:
@calvernaz
calvernaz / cdk.zip
Created January 12, 2022 13:41
cdklocal path vs host
1
resource "aws_api_gateway_rest_api" "api" {
name = "example"
}
resource "aws_api_gateway_resource" "resource" {
rest_api_id = aws_api_gateway_rest_api.api.id
parent_id = aws_api_gateway_rest_api.api.root_resource_id
path_part = "resource"
}
@calvernaz
calvernaz / json
Created January 3, 2022 21:25
PetStore template
{
"swagger": "2.0",
"info": {
"description": "Your first API with Amazon API Gateway. This is a sample API that integrates via HTTP with our demo Pet Store endpoints",
"title": "PetStore"
},
"schemes": [
"https"
],
"paths": {
# VERSIONS
LORA_VERSION=3
# CREDENTIALS
REDIS_PASSWORD=p4ssw0rd
POSTGRES_PASSWORD=p4ssw0rd
MQTT_PASSWORD=p4ssw0rd
@calvernaz
calvernaz / docker-compose.yml
Created August 31, 2019 20:23
LoRa Server stack
version: '2.2'
services:
mysql:
container_name: mysql
image: bitnami/mysql:latest
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=admin
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=livedata

Keybase proof

I hereby claim:

  • I am calvernaz on github.
  • I am calvernaz (https://keybase.io/calvernaz) on keybase.
  • I have a public key whose fingerprint is 2A50 B47F A574 981D 978C 7A04 5AA5 1692 F4F3 1D2D

To claim this, I am signing this object:

package org.weirdloop;
import org.jctools.queues.atomic.SpscAtomicArrayQueue;
import java.util.Collection;
import java.util.Timer;
import java.util.TimerTask;
import java.util.function.Consumer;
class BatchQueue<T> {
package flatten
// FlattenCopy flattens array of integers
// using the built-in copy function
func FlattenCopy(arr [][]int) []int {
r := make([]int, len(arr))
i := 0
for _, a := range arr {
if len(a) + i <= cap(r) {
copy(r[i:], a)