Skip to content

Instantly share code, notes, and snippets.

View jcollum's full-sized avatar

Justin Collum jcollum

View GitHub Profile
✗ TF_LOG=trace terraform -chdir=infrastructure init -backend=false
2021-09-22T11:33:43.381-0700 [DEBUG] Adding temp file log sink: /var/folders/tm/rdcrzyq15f13fyhmk02pscg9_l1nl3/T/terraform-log209965300
2021-09-22T11:33:43.381-0700 [INFO] Terraform version: 1.0.7
2021-09-22T11:33:43.382-0700 [INFO] Go runtime version: go1.16.4
2021-09-22T11:33:43.382-0700 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/2.1.0/versions/1.0.7/terraform", "-chdir=infrastructure", "init", "-backend=false"}
2021-09-22T11:33:43.382-0700 [TRACE] Stdout is a terminal of width 158
2021-09-22T11:33:43.382-0700 [TRACE] Stderr is a terminal of width 158
2021-09-22T11:33:43.382-0700 [TRACE] Stdin is a terminal
2021-09-22T11:33:43.382-0700 [DEBUG] Attempting to open CLI config file: /Users/justin.collum/.terraformrc
2021-09-22T11:33:43.382-0700 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
@jcollum
jcollum / flatten.js
Created November 5, 2019 21:05
flatten
/*
assumption: result is initialized in outer scope before first call
*/
const flatten = (input, result) => {
// check inputs
if (!Array.isArray(input))
throw new Error("Input to this function is required to be an array");
@jcollum
jcollum / HighlightedLink.svelte
Created September 11, 2019 18:49
Svelte + Sapper highlighted link (component that is aware of current url)
@jcollum
jcollum / gist:ab8ebd854b844a4dd10bc3ebaf41c90d
Created June 7, 2019 16:36
find by port, cross platform
port=3001
kill $(netstat -tuwanp | grep $port | awk '{print $7}' | cut -d "/" -f 1 )
@jcollum
jcollum / gist:79e204028588b39aad1f09c19e4b3478
Last active June 4, 2019 00:49
wait for site to come up (bash, curl)
# wait a little for the server to come up
until curl 'http://localhost:3000/foo' -s -f -o /dev/null; do
sleep 2;
done
@jcollum
jcollum / mock.js
Created October 11, 2018 23:35
Mock a few functions in a module with many exports (Jest 22)
// file __mocks__/selectors.js
// this file mocks the selectors.js module
const actual = require.requireActual('../selectors')
const mockBase = jest.genMockFromModule('../selectors');
// eslint-disable-next-line security/detect-object-injection,no-return-assign
Object.keys(actual).forEach(key => (mockBase[key] = actual[key]));
mockBase.getCountry = jest.fn();
@jcollum
jcollum / multiPluck.coffee
Created September 2, 2015 20:26
a multi-pluck mixin for lodash
ld = require 'lodash'
assert = require("assert")
multiPluck = (input,keys) ->
pluckFrom = (o,keys) ->
result = {}
for k in keys
unless result[k]?
result[k] = o[k] or undefined
@jcollum
jcollum / private.xml
Created June 18, 2015 21:36
Karabiner keymap file to map Chrome js debugging keys to the F13-F16 keys on a Mac 101 key keyboard
<?xml version="1.0"?>
<root>
<appdef>
<appname>CHROME</appname>
<equal>com.google.Chrome</equal>
</appdef>
<item>
<name>CHROMEDEBUGGINGKEY</name>
<appendix>This maps the F13, F14 and F15 keys to Chrome debugging keys</appendix>
@jcollum
jcollum / gist:5454854
Created April 24, 2013 19:28
grunt watcher for multiple-to-multiple coffee-to-js compililation (with source maps)
###
command line: grunt watch
###
# global module:false
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
watch: