Skip to content

Instantly share code, notes, and snippets.

View wkiefer's full-sized avatar

Will Kiefer wkiefer

View GitHub Profile
@jspahrsummers
jspahrsummers / macroview.sh
Last active December 10, 2015 07:38
This simple script will preprocess one or more source files, and try to indent them nicely such that expanded macros are made readable. This is useful for debugging the logic of rampant macros.
#!/bin/sh
#
# Example usage:
# ./macroview.sh -IThirdPartyHeadersToInclude file.m
clang -E -nostdinc -nobuiltininc "$@" 2>/dev/null | indent -bl -nce -nei
@peteburtis
peteburtis / gist:5251160
Created March 27, 2013 02:44
I take credit for less than 10% of this. Sadly I've lost the source.
#add git branch to prompt; paste at the end of your .bash_profile
function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\[\1\]/'
}
PS1="\h:\W\[\033[0;31m\]\$(parse_git_branch_and_add_brackets)\[\033[0m\] \u\$ "
@vilhalmer
vilhalmer / gist:3052f7e9e7f34b92a40f
Created November 1, 2014 01:28
NSVisualEffectView undocumentation
NSVisualEffectMaterial constants, and the undocumented materials they coorespond to in various modes:
+----------------------+-------+----------+------+---------+
| MATERIAL # | LIGHT | LIGHT EM | DARK | DARK EM |
+----------------------+-------+----------+------+---------+
| | | | | |
| 0 - Appearance Based | 3 | 3 | 5 | 5 |
| | | | | |
| 1 - Light | 3 | 3 | 3 | 3 |
| | | | | |
| 2 - Dark | 4 | 4 | 4 | 4 |
@markd2
markd2 / testprof.m
Last active June 2, 2017 16:43
code coverage on the command line
#import <stdio.h>
// xcrun clang -g -Wall -Werror -fprofile-instr-generate -fcoverage-mapping -o testprof testprof.m
// ./testprof
// xcrun llvm-profdata merge -o testprof.profdata default.profraw
// xcrun llvm-cov show ./testprof -instr-profile=testprof.profdata testprof.m
static int DoSomething (int value) {
if (value == 55) {
@duluca
duluca / awc-ecs-access-to-aws-efs.md
Last active October 11, 2024 16:44
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide: