Skip to content

Instantly share code, notes, and snippets.

View ridjex's full-sized avatar

Andrew ridjex

View GitHub Profile
@mukandrew
mukandrew / .editorconfig
Created February 25, 2022 15:03
Android Kotlin EditorConfig
root = true
[*]
charset = utf-8
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 100
tab_width = 4
@hoegertn
hoegertn / init.py
Created September 14, 2020 09:04
CDK bootstrap helper
import json
import inquirer
import boto3
import os
import sys
import subprocess
def select_account():
@thedmeyer
thedmeyer / README.md
Last active April 17, 2024 14:38
PlantUML Github Action for generating SVGs

PlantUML GitHub Action

To use this action, you must include a copy of the plantuml.jar file within the root directory of your repository. You can get this file here at: https://sourceforge.net/projects/plantuml/files/plantuml.jar/download

Or run this curl command in your root directory: curl -o plantuml.jar https://iweb.dl.sourceforge.net/project/plantuml/plantuml.jar

How It Works

This action works by recursively searching for PlantUML files with the extension .pu in a subdirectory named src.

@luismts
luismts / GitCommitBestPractices.md
Last active April 30, 2025 04:15
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@magnetikonline
magnetikonline / README.md
Last active September 16, 2024 14:23
CloudFormation API Gateway endpoint calling a Lambda function using proxy integration example.

CloudFormation API Gateway integration to Lambda function

Template that will create the following:

  • API Gateway:
    • Deployed as a REGIONAL endpoint.
    • Single root method, accepting POST requests only, with Lambda proxy integration to a target function.
  • In-line Python Lambda function echoing back requesting users IP address to API Gateway requests:
    • IAM role for Lambda allowing CloudWatch logs access.
    • Permissions for Lambda that allow API Gateway endpoint to successfully invoke function.
@bastman
bastman / auth0.kt
Last active March 3, 2023 09:48
kotlin-spring-security-auth0-api-utils: extensions for auth0 (e.g. handle custom claims)
package com.example.auth0utils
import com.auth0.jwk.JwkProviderBuilder
import com.auth0.jwt.JWT
import com.auth0.jwt.JWTVerifier
import com.auth0.jwt.exceptions.JWTDecodeException
import com.auth0.jwt.exceptions.JWTVerificationException
import com.auth0.jwt.interfaces.DecodedJWT
import com.auth0.spring.security.api.JwtAuthenticationEntryPoint
import com.auth0.spring.security.api.JwtAuthenticationProvider
@BurakDizlek
BurakDizlek / safeEnumKotlin.kt
Last active June 14, 2019 09:27
no enum constant for default safe enum value
inline fun <reified T : kotlin.Enum<T>> safeEnumValueOf(type: String?,defaultEnum:T): T {
return try {
java.lang.Enum.valueOf(T::class.java, type)
} catch (e: Exception) {
defaultEnum
}
}
@nmarley
nmarley / dec.py
Last active March 6, 2025 11:56
AWS KMS encryption/decryption using Python/Boto3
import boto3
import base64
if __name__ == '__main__':
session = boto3.session.Session()
kms = session.client('kms')
encrypted_password = 'AQECAHjgTiiE7TYRGp5Irf8jQ3HzlaQaHGYgsUJDaavnHcFm0gAAAGswaQYJKoZIhvcNAQcGoFwwWgIBADBVBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDwxVQuG0oVwpkU7nQIBEIAoVGk1/wpserb+GVUOzE7PiL/Nr9fTDFKZfpKpF0ip2ct4B2q0Wn6ZZw=='
binary_data = base64.b64decode(encrypted_password)
@novotnyr
novotnyr / redis-session.sh
Created November 29, 2016 14:19
redis-cli utility to handle Spring Security / Spring Session sessions
#!/bin/sh
COMMAND="$1"
REDIS_CLI="redis-cli"
case "$COMMAND" in
list)
"$REDIS_CLI" keys 'spring:session:sessions:[a-f0-9][a-f0-9]*'
;;
hkeys)
@yozik04
yozik04 / Dockerfile
Created November 24, 2016 14:32
PHP 7 fpm, alpine, mongodb and composer
FROM php:7-fpm-alpine
RUN apk --update add --virtual build-dependencies build-base openssl-dev autoconf \
&& pecl install mongodb \
&& docker-php-ext-enable mongodb \
&& apk del build-dependencies build-base openssl-dev autoconf \
&& rm -rf /var/cache/apk/*
# Time Zone
RUN echo "date.timezone=${PHP_TIMEZONE:-UTC}" > $PHP_INI_DIR/conf.d/date_timezone.ini