Skip to content

Instantly share code, notes, and snippets.

View devilelephant's full-sized avatar

George Coller devilelephant

  • Minneapolis, MN
  • 22:39 (UTC -06:00)
View GitHub Profile
@devilelephant
devilelephant / README.md
Last active June 3, 2024 20:14
Fix fzf "**" not working in zsh

Fix fzf "**" not working in my zsh config

In my .zshrc file I had the appropriate command:

 source <(fzf --zsh)

And the keybindings worked but the "**" completion did not.

@devilelephant
devilelephant / next.config.mjs
Last active April 30, 2024 19:57
Next.js 14 MDX fix when running --turbo dev server
import nextMDX from "@next/mdx";
/** @type {import(&apos;next&apos;).NextConfig} */
const nextConfig = {
pageExtensions: ["js", "jsx", "ts", "tsx", "mdx"],
experimental: {
mdxRs: true
},
};
const withMDX = nextMDX({
@devilelephant
devilelephant / README.md
Last active July 5, 2023 20:33
Protect Branches With GH

Script Branch Protection for Github

Display current protection rules for "main"

gh api repos/:owner/:repo/branches/main/protection

Add branch protection

@devilelephant
devilelephant / README.md
Created June 19, 2023 15:06
Create self-signed StirShaken Certificates for unit testing
@devilelephant
devilelephant / Dockerfile
Last active August 26, 2022 21:54
Multipart Dockerfile to download Open Policy Agent into an AWS Lambda
# Pull latest static opa executable image
FROM openpolicyagent/opa:latest-static AS opa-stage
# Start lambda image
FROM public.ecr.aws/lambda/java:11
ARG OPA_INSTALL_PATH=${LAMBDA_TASK_ROOT}/opa
ARG OPA_EXECUTABLE_PATH=${OPA_INSTALL_PATH}/opa
COPY --from=opa-stage /opa ${OPA_INSTALL_PATH}/
@devilelephant
devilelephant / google-cloud-env-creds.js
Created March 20, 2019 21:59
Google Cloud Environment Credentials
// Configure Google Cloud library with JSON credentials in an environment variable
const
os = require('os'),
fs = require('fs')
;
exports.configureGoogleCloud = function (isWarnOnly) {
// if standard GOOGLE_APPLICATION_CREDENTIALS is set then use that
if (!process.env['GOOGLE_APPLICATION_CREDENTIALS']) {
@devilelephant
devilelephant / README.md
Last active April 17, 2018 19:24
Json Tranform Lambda

JsonTransform

Transform Json Input

function input

Use a Pass type Step Function to merge a script under the field name "transformScript into the input JSON.

"Inject Update Status and Updated": {
 "Type": "Pass",
@devilelephant
devilelephant / BeatBuddyWorldPercussionMidiChart.tsv
Created February 17, 2018 23:58
Beat Buddy World Percussion Midi Chart
Midi Note Note Name
85 C#5 Bongo Low - palm
84 C5 Bongo Low - closed slap
82 A#4 Shaker
75 D#4 Clave
59 B2 Splash2
57 A2 Hand Crash 2
56 G#2 Cowbell
55 G2 Splash 1
54 F#2 Tambourine
@devilelephant
devilelephant / AWS4Signer.groovy
Last active October 21, 2019 08:24
Java/Groovy example of using Amazon AWS AWS4Signer class to sign requests (in our case elasticsearch calls)
package com.clario.aws
import com.amazonaws.DefaultRequest
import com.amazonaws.SignableRequest
import com.amazonaws.auth.AWS4Signer
import com.amazonaws.auth.AWSCredentialsProvider
import com.amazonaws.http.HttpMethodName
import groovy.util.logging.Slf4j
import org.apache.http.client.utils.URLEncodedUtils
import org.springframework.http.HttpHeaders
@devilelephant
devilelephant / gist:0bcd66cde78e82282e62
Created July 8, 2014 21:14
Spring Boot Fix @RequestMapping error on paths with dots or file extensions
// I made one of my @Configuration classes extend org.springframework.beans.factory.config.BeanPostProcessor
// There probably is a better way to intecept the ContentNegotiationManager when it is being updated but I couldn't figure out how
// This solved the problems I had better than using the {id:.+} regular expression in path variables idea I've seen on other fixes.
@Override
Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
if (bean instanceof RequestMappingHandlerMapping) {
// handle when dots in url path