This file contains hidden or 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
PARENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &>/dev/null && pwd)" | |
echo "BASH_SOURCE: ${BASH_SOURCE[0]}" | |
echo "PARENT_DIR: $PARENT_DIR" |
This file contains hidden or 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
import { tty } from "https://deno.land/x/[email protected]/ansi/tty.ts"; | |
interface ProgressBarOptions { | |
label?: string; | |
total?: number; | |
width?: number; | |
} | |
/** | |
* A simple progress bar for Deno |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# Adapted as a fix for https://github.com/spotify/backstage/blob/master/docker/run.sh | |
# | |
# Call with | |
local key_map='{ "BACKEND_BASEURL": "backend_baseUrl" }' | |
config="$(jq --arg keyMap "$key_map" -n 'env | | |
def swap_key($k): $keyMap | fromjson | if has($k) then with_entries(select(.key == $k)) | .[] else $k end; |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# description: | |
# Symlink a short name to an exact version | |
# | |
# usage: | |
# asdf-alias <plugin> <name> [<version> | --auto | --remove]" | |
# asdf-alias <plugin> --auto" | |
# asdf-alias <plugin> [--list]" | |
# |
This file contains hidden or 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
server { | |
# ... | |
set $tracking_id 'UA-#########'; | |
sub_filter "</head>" "<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');ga('create', '$tracking_id', 'auto');ga('send', 'pageview');</script></head>"; | |
} |
This file contains hidden or 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
// lodash - reduceAll/Assign (using fp/over) | |
const fp = require("[email protected]/fp"); | |
let data = [{valA: 1, valB: 2}, {valA: 2, valB: 3}]; | |
const reduce1 = fp.sumBy('valA'); | |
const reduce2 = fp.sumBy('valB'); | |
const reducers = [reduce1, reduce2]; | |
const reducedKeys = ['sumA', 'sumB']; |
This file contains hidden or 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
const R = require('ramda'), | |
prop = R.prop, | |
path = R.path, | |
curry = R.curry; | |
// Test Data | |
let user1 = { | |
id: 1, | |
login: 'andrew', | |
details: { |
This file contains hidden or 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
import * as Rx from 'rxjs'; | |
import { setInterval } from 'timers'; | |
const mockInterval = Rx.Observable.create(obs => { | |
let i = 0; | |
setInterval(function() { | |
i = i + 1; | |
obs.next(i); | |
}, 500); | |
}); |
This file contains hidden or 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
#!/usr/bin/env node | |
/* eslint-env node */ | |
/* eslint-disable no-console */ | |
const path = require('path'); | |
const replace = require('replace'); | |
const argv = require('yargs').argv; | |
const targetPath = path.join(__dirname, '../dist/'); |
This file contains hidden or 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
# Replace-Vars script | |
# | |
# Description: | |
# Replaces varibles in the specified files | |
# | |
# Usage: | |
# Replace-Vars.ps1 [files_to_update_array] [config_vars_hash] | |
# | |
# Examples: | |
# ./Replace-Vars.ps1 ./file1.txt @{ API_URL = 'MY_VAR' } |
NewerOlder