Skip to content

Instantly share code, notes, and snippets.

View hjander's full-sized avatar

Hendrik Jander hjander

  • Freelance Cloud/Software Architect
  • Dubai
  • 15:34 (UTC -12:00)
  • X @hj4nder
View GitHub Profile
@tedivm
tedivm / aws_login.yml
Last active June 9, 2024 02:42
AWS ECR Github Actions OIDC
jobs:
deploy:
name: Push to ECR
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
@reegnz
reegnz / README.md
Last active October 22, 2024 13:55
The Terraform group_by you've been missing

The Terraform group_by you've been missing

I'm playing around a lot nowadays with Terraform 0.13 and I found a really interesting feature and that's the ... symbol (also called an ellipsis) to be used with for expressions.

The operator can be used for group_by operations.

Example

We have a list of entries. The list contains employee/manager/project triplets.

@josemarimanio
josemarimanio / install_pyenv_mac_zsh.rst
Created May 13, 2020 12:13
Installing pyenv on macOS for Zsh using Homebrew
@EliasRanz
EliasRanz / MongoConfig.java
Last active June 12, 2024 19:48
Mongo Configuration for Amazon DocumentDB utilizing Spring-Boot and spring-data-mongodb
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
@saidsef
saidsef / lambda_cpu_cores.md
Last active October 16, 2024 01:38
AWS Lambda CPU Cores
@ubergarm
ubergarm / aws-lambda-stats.md
Last active March 4, 2020 15:06
AWS-lambda-stats

AWS lambda status

Some info about what kind of server you get inside a lambda function on AWS.

memory_size = 1536

Linux

$ uname -a
Linux ip-10-25-140-177 4.9.43-17.39.amzn1.x86_64 #1 SMP Fri Sep 15 23:39:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@plindberg
plindberg / README.md
Created August 5, 2017 16:46
How to set up an AWS Lambda function for returning S3 pre-signed URLs for uploading files.

README

Granted, this is little more than an obfuscated way of having a publicly writable S3 bucket, but if you don’t have a server which can pre-sign URLs for you, this might be an acceptable solution.

For this to work, you take the following steps:

  1. Create a Lambda func, along with a new IAM role, keeping the default code.
  2. Create an API in the API Gateway.
@odrotbohm
odrotbohm / FizzBuzz.java
Last active March 21, 2017 16:48
FizzBuzz functional style inspired by @Dierk's talk on Frege
/**
* FizzBuzz functional style. Inspired by @mittie's Frege talk and @kevlinhenney.
*
* Uses Protonpack's {@code StreamUtils} for zipping
*
* @see https://github.com/poetix/protonpack
*/
public class FizzBuzz {
public static void main(String[] args) {
public class BigPipeServlet extends HttpServlet {
private static ExecutorService executor = Executors.newFixedThreadPool(500, new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setName("Service Thread "+ t.getId());
t.setDaemon(true);
return t;
}
});