Skip to content

Instantly share code, notes, and snippets.

@jitran
jitran / app.py
Last active September 18, 2022 00:09
AWS CDK Python - Overriding the resource logical IDs
#!/usr/bin/env python3
from aws_cdk import core
from my_python_sample.my_python_sample_stack import MyPythonSampleStack
app = core.App()
MyPythonSampleStack(app, 'my-python-sample', env={'region': 'ap-southeast-2'})
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active July 1, 2024 15:05
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
/*
This is a script to dump out the 4byte identifier for the last N transactions,
along with some other stats about recent transactions.
execute with
$./build/bin/geth js dumper.js > dump.json
@author mhswende
@fsargent
fsargent / auth0-kong.md
Last active February 17, 2024 15:07
JWT Validation with Auth0 and Kong

To get setup with Auth0 and Kong.

Kong is pretty cool. Auth0 is pretty cool. They should work together. This guide details the fastest way to get your APIs protected using JWT tokens issued by Auth0.

Pre-requisites:

  • Create a Auth0 account. Account name is referred to "COMPANYNAME" for the sake of the guide.
  • Setup a Kong instance on your machine. This guide assumes a brand new blank instance.
  • Install httpie - a http command line utility built for humans (unlike curl).
@ajeetraina
ajeetraina / docker-compose.yml
Created March 7, 2017 08:55
Docker Compose v3.1 file for Secret Management under Docker 1.13
version: "3.1"
services:
db:
image: "mysql:latest"
networks:
collabnet:
aliases: ["db"]
volumes:
- "db_data:/var/lib/mysql"
secrets:
@stefanbuck
stefanbuck / upload-github-release-asset.sh
Last active November 26, 2023 12:40
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
@leonardofed
leonardofed / README.md
Last active July 11, 2024 02:18
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# Forked by rjorgenson - http://github.com/rjorgenson
#
# # README
#
# In order for this theme to render correctly, you will need a
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active June 17, 2024 15:05
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@TonyStarkBy
TonyStarkBy / redis-idle-clean.lua
Last active May 13, 2020 08:51
redis: delete keys by idle time
-- how to use:
-- redis-cli EVAL "$(cat redis-idle-clean.lua)" 2 key_name 86400
local keyTemplate = KEYS[1]
local keyMinIdleTime = tonumber(KEYS[2])
local function getUsedMemory()
local info = redis.call('info')