Skip to content

Instantly share code, notes, and snippets.

View jbenninghoff's full-sized avatar

John Benninghoff jbenninghoff

  • Ventura, CA, United States
View GitHub Profile
@pch
pch / finder-macvim-file-drawer.md
Created April 23, 2020 08:47
How to Use macOS Finder as a MacVim File Drawer

How to Use macOS Finder as a MacVim File Drawer

When I switched to Vim from TextMate 2, the feature I missed the most was a decent file drawer (no, NERDTree doesn't cut it). I'm happy with [fzf.vim][fzf], but having the project tree in front of you can be really useful from time to time, e.g. when working with unfamiliar codebase, a new project etc.

The solution for it is surprisingly simple (although not without flaws): use MacVim with a Finder window in Split View mode:

# Pull in existing VPC
data "aws_vpc" "selected" {
id = var.vpc_id
}
# Subnet ids data source lookup allows multiple subnets to be provided
data "aws_subnet_ids" "private" {
vpc_id = data.aws_vpc.selected.id
filter {
@muralisc
muralisc / install-tmux.sh
Last active April 9, 2024 15:47 — forked from pokev25/install-tmux.sh
Install tmux 3.0a on Amazon Linux 2 / rhel /centos
# Install tmux 3.0a on Centos
# install deps
sudo yum install -y gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
tar -xf libevent-2.1.11-stable.tar.gz
cd libevent-2.1.11-stable
./configure --prefix=/usr/local
@ian-whitestone
ian-whitestone / notes.md
Last active March 1, 2023 01:45
Best practices for presto sql

Presto Specific

  • Don’t SELECT *, Specify explicit column names (columnar store)
  • Avoid large JOINs (filter each table first)
    • In PRESTO tables are joined in the order they are listed!!
    • Join small tables earlier in the plan and leave larger fact tables to the end
    • Avoid cross joins or 1 to many joins as these can degrade performance
  • Order by and group by take time
    • only use order by in subqueries if it is really necessary
  • When using GROUP BY, order the columns by the highest cardinality (that is, most number of unique values) to the lowest.
@thsutton
thsutton / vault-get-keytab.sh
Last active February 23, 2022 22:37
Get a Kerberos keytab from Hashicorp vault.
#!/bin/sh
# vault-get-keytab
#
# Rather than verify that it’s exactly the keytab we expect, this script checks that it is
# (or appears to be) a keytab for the required principal.
set -eu
$vault_path=“$1”
@aviemzur
aviemzur / emr_add_step_example.py
Created December 27, 2018 11:48
emr_add_step_example.py
from datetime import timedelta
import airflow
from airflow import DAG
from airflow.contrib.operators.emr_create_job_flow_operator \
import EmrCreateJobFlowOperator
from airflow.contrib.operators.emr_add_steps_operator \
import EmrAddStepsOperator
from airflow.contrib.sensors.emr_step_sensor import EmrStepSensor
from airflow.contrib.operators.emr_terminate_job_flow_operator \
@iaverin
iaverin / rest35.py
Last active September 5, 2023 19:58
Simple and functional REST server for Python (3.5) using no dependencies beyond the Python standard library. Ported from https://gist.github.com/tliron/8e9757180506f25e46d9
#!/usr/bin/env python
'''
Simple and functional REST server for Python (3.5) using no dependencies beyond the Python standard library.
Ported from original lib for Python 2.7 by Liron (tliron @ github.com) https://gist.github.com/tliron/8e9757180506f25e46d9
Features:
* Map URI patterns using regular expressions
* Map any/all the HTTP VERBS (GET, PUT, DELETE, POST)
* All responses and payloads are converted to/from JSON for you
* Easily serve static files: a URI can be mapped to a file, in which case just GET is supported

Source: https://gist.github.com/findepi/04c96f0f60dcc95329f569bb0c44a0cd .

quick build

./mvnw -T2C clean install -nsu -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Dair.check.skip-all=true -pl '!:trino-server-rpm,!:trino-docs,!:trino-proxy,!:trino-verifier,!:trino-benchto-benchmarks'

run Trino in a container, quickly

docker rm -f trino; docker run --rm -it --name trino -p 8080:8080 trinodb/trino:438
@justmiles
justmiles / ipa.tf
Last active September 9, 2022 06:06
Deploy FreeIPA in AWS using Terraform
# Notes:
# You'll need to update any references to 'module.vpc' with your VPC's info (subnets, security groups, etc)
# If you define your subnets as a map, this will deploy different replicas across availabity zones. Note
# that the master and first replica will be in the same AZ.
#
# Look through the 'connection' fields and update with your bastion_host/key combos
#
# Number of IPA Replica(s) to deploy
variable "ipa_replicas" {
@danidiaz
danidiaz / netrw.txt
Created October 7, 2016 20:57
Vim's netrw commands.
--- ----------------- ----
Map Quick Explanation Link
--- ----------------- ----
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
<c-h> Edit file hiding list |netrw-ctrl-h|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
<c-r> Browse using a gvim server |netrw-ctrl-r|
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|