This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildGraph(edges) { | |
const graph = {}; | |
for (let edge of edges) { | |
const [ a, b ] = edge; | |
if (!(a in graph)) graph[a] = []; | |
if (!(b in graph)) graph[b] = []; | |
graph[a].push(b); | |
graph[b].push(a); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: "{{ host_pattern }}" | |
gather_facts: yes | |
become: yes | |
tasks: | |
- name: Determine namespace (with app_id) | |
set_fact: | |
consul_namespace: "{{ facter_app_env }}-{{ facter_app_id }}" | |
when: facter_app_id != '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fetch(ctx context.Context, cfg sink.SinkConfig) (result resource.Resource, err error) { | |
methods := map[sink.SinkKind]func(string, string, string) (resource.Resource, error){ | |
sink.CertKind: certs.GetCert, | |
sink.SecretKind: secrets.GetSecret, | |
sink.KeyKind: keys.GetKey, | |
} | |
if methods[cfg.Kind] == nil { | |
log.Panicf("Invalid sink kind: %v\n", cfg.Kind) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cjohnson in ~/ | |
$ gdate -d 'yesterday' +'%F %T %z %Z' | |
2019-12-10 13:35:54 -0500 EST | |
cjohnson in ~/ | |
$ docker ps --format '{{.ID}}\t{{.CreatedAt}}' | awk -F '\t' '{print $2}' | |
2019-12-11 13:14:47 -0500 EST | |
cjohnson in ~/ | |
$ docker ps --format '{{.ID}}\t{{.CreatedAt}}' | awk -F '\t' '$2 <= "'$(gdate +'%F %T %z %Z')'" { print $1 }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){ | |
'use strict'; | |
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; | |
module.exports = function (str) { | |
if (typeof str !== 'string') { | |
throw new TypeError('Expected a string'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check for dependencies | |
type git >/dev/null 2>&1 || { echo >&2 "You need git installed to run this script"; exit 1; } | |
type npm >/dev/null 2>&1 || { echo >&2 "You need nodejs/npm installed to run this script"; exit 1; } | |
# Clone the repos | |
if [ ! -d "AD" ]; then | |
git clone git@github.com:StalwartJourneys/AD.git || { echo >&2 "Unable to clone AD repository, you likely forgot to set up your SSH key in your github account"; exit 1; } | |
cd AD |