Skip to content

Instantly share code, notes, and snippets.

View themathmagician's full-sized avatar

themathmagician

View GitHub Profile
@rollendxavier
rollendxavier / .tflint.hcl
Created February 1, 2022 07:19
A sample tflint hcl configuration file for terraform with Azure
config {
module = true
disabled_by_default = false
varfile = ["dev.tfvars", "prod.tfvars"]
}
plugin "azurerm" {
enabled = true
version = "0.14.0"
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
# Source: https://gist.github.com/808108069f709572f1bc372c65f6b5c0
###########
# Prepare #
###########
# Option 1:
# Create a Kubernetes cluster
# Install NGINX Ingress
# Install Argo CD
@mattmahn
mattmahn / README.md
Last active March 26, 2024 23:26
Terraform: Get current Git commit SHA

This will return the full Git commit SHA of whichever branch is currently checkedout.

Dump the snippet into terraform console (run from within a Git repo) to see for yourself.

Tainting and Labeling Kubernetes Nodes to Run Special Workload - A quick guide that is finally NOT confusing

All right folks, I intend to keep this one short and that's what I will do. I mean, it's supposed to be easy but the official documentations(1, 2) make it unnecessary confusing. So I think maybe I can help filling in the gap.

I will be using one of our business requirements at Buffer in this project, as the example for this blog post.

Quick recap

So, we need a few nodes that are dedicated to running cronjobs, and nothing else. At the same time we want to make sure the cornjobs are scheduled to these nodes, and nowhere else. This means we need 2 things

@mdlavin
mdlavin / lambda-function-xray-enablement.tf
Last active March 18, 2024 14:38
Terraform configuration to enable X-Ray for a Lambda function
resource "aws_lambda_function" "service" {
# Your usual aws_lambda_function configuration settings here
tracing_config {
mode = "Active"
}
}
@tinkerware
tinkerware / macos-jdk-install.md
Last active October 19, 2023 08:22
Maintaining Java Installs on macOS Using Homebrew Cask

Maintaining Java Installs on macOS Using Homebrew Cask

Recently, I upgraded my MacBook Pro from a old, trusty Yosemite to Sierra, and reluctantly had to clean out the old JDK versions I had accumulated over a few years. I also wanted to have a Java 9 JDK to play around with the new module system and API’s.

Good news is that, for a while now, you have been able to install and upgrade multiple versions of JDK using only your shell, without having to deal with Oracle’s graphical installers.

To install Java from scratch, install Homebrew Cask cask-update (you need to have Homebrew already installed) first, then install Java using Cask:

brew tap buo/cask-upgrade & brew tap caskroom/versions
brew cask install java8
@bivihoba
bivihoba / Dockerfile
Created October 13, 2017 09:02
Potrace Sandbox Dockerfile
FROM alpine:3.6
RUN apk add --no-cache --update gcc make automake autoconf libtool musl-dev zlib-dev git openssl nodejs nodejs-npm imagemagick
RUN git clone https://github.com/skyrpex/potrace.git && \
cd potrace && \
autoreconf -i && \
./configure && make && make install
RUN npm install -g svgo
@jherax
jherax / filterArray.js
Last active February 23, 2024 12:59
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@onjin
onjin / docker-compose.yml
Created September 5, 2016 09:17
example docker compose for postgresql with db init script
postgres:
image: postgres:9.4
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
@dwmkerr
dwmkerr / setup-sublime3-for-angular2.md
Last active April 11, 2020 03:30
Quickly setup Sublime Text 3 for Angular 2

Quick Setup for Sublime Text 3 for Angular 2

Easy to remember, easy to forget.

Step 1: Download Sublime Text 3

Sublime Text 3 Download

Step 2: Create a bash shortcut

It's nice to be able to run subl in a terminal.