Skip to content

Instantly share code, notes, and snippets.

View ridjex's full-sized avatar

Andrew ridjex

View GitHub Profile
@subfuzion
subfuzion / github-wiki-how-to.md
Last active March 13, 2025 09:40
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: [email protected]:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?

@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active December 23, 2024 15:56 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@thomasdarimont
thomasdarimont / App.java
Last active April 18, 2025 07:57
Secure REST API Example with Spring Security, Spring Session, Spring Boot
package demo;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@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
@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)
@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)
@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
}
}
@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
@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.
@luismts
luismts / GitCommitBestPractices.md
Last active May 19, 2025 06:40
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.