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
import { | |
FormGroup, | |
FormRecord, | |
FormArray, | |
ValidationErrors | |
} from '@angular/forms'; | |
export function getFormValidationErrors(form: FormGroup|FormRecord|FormArray, path ?: string = '$') { | |
const result = []; |
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
// MultiString.pipe.ts | |
import { | |
Pipe, | |
PipeTransform | |
} from '@angular/core'; | |
@Pipe({ name: 'multiString' }) | |
export class MultiStringPipe implements PipeTransform { | |
function transform(...values: string[]): string { | |
return values |
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
const arr = [ | |
{ id: 1, val: 'a' }, | |
{ id: 2, val: 'b' }, | |
{ id: 1, val: 'a' }, | |
{ id: 1, val: 'c' } | |
]; | |
const uni = arr | |
.reduce( ( unique, item ) => | |
unique.some( existing => |
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 | |
# https://gist.github.com/lukebussey/70fe3b245c7b55fa41300670d2698e54#gistcomment-2636296 | |
sudo rm -R /Library/Sophos\ Anti-Virus/ | |
sudo rm -R /Library/Application\ Support/Sophos/ | |
sudo rm -R /Library/Preferences/com.sophos.* | |
sudo rm /Library/LaunchDaemons/com.sophos.* | |
sudo rm /Library/LaunchAgents/com.sophos.* | |
sudo rm -R /Library/Extensions/Sophos* | |
sudo rm -R /Library/Caches/com.sophos.* | |
~/Applications/Remove\ Sophos\ Endpoint |
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 | |
# production|preprod | |
command -v jq >/dev/null 2>&1 || { echo >&2 "I require jq but it's not installed. Try 'brew install jq' Aborting."; exit 1; } | |
command -v curl >/dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Try 'brew install curl' Aborting."; exit 1; } | |
command -v perl >/dev/null 2>&1 || { echo >&2 "I require perl but it's not installed. Try 'brew install perl' Aborting."; exit 1; } | |
command -v tr >/dev/null 2>&1 || { echo >&2 "I require tr but it's not installed.' Aborting."; exit 1; } | |
case $1 in | |
production|preprod) | |
platform=$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
#!/bin/bash | |
# Your bastion username should be in ~/.ssh/config | |
# platform path [container] | |
# preprod /routes/genesys/router.js tripnotificationagent | |
export platform=$1 | |
export repo=$(basename "$PWD") | |
export filename=$2 | |
export container=$3 | |
if [ -z ${container} ]; then export container=$(grep '"name":\s*"\w*",' $PWD/package.json | awk -F '"' '{ print $4 }'); fi | |
export service="rmpay_${container}_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
#!/bin/bash | |
# Your bastion username should be in ~/.ssh/config | |
# platform [container] | |
# preprod tripnotificationagent | |
export platform=$1 | |
export container=$2 | |
if [ -z ${container} ]; then export container=$(grep '"name":\s*"\w*",' $PWD/package.json | awk -F '"' '{ print $4 }'); fi | |
echo "Container: $container" | |
if [ -z ${container} ]; | |
then |
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 | |
# Your bastion username should be in ~/.ssh/config | |
# on|off platform [container] | |
# on preprod tripnotificationagent | |
export setting=$1 | |
export platform=$2 | |
export container=$3 | |
if [ -z ${container} ]; then export container=$(grep '"name":\s*"\w*",' $PWD/package.json | awk -F '"' '{ print $4 }'); fi | |
export service="rmpay_${container}_1" | |
case $setting in |
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 | |
export GIT_ROOT=/Volumes/Routematch/Git | |
doit() { | |
cd $GIT_ROOT/$1 | |
# What branch is this repo on? | |
# If master branch, checkout package.json and pull latest updates | |
# If .nvmrc exists, use specified version, else use node version 4 | |
# Update dependencies |
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
const jsonData = JSON.parse(responseBody); | |
const payload = jsonData.id_token.split('.')[1]; // Assuming the JWT is in id_token | |
const parsed = JSON.parse(atob(payload)); | |
pm.environment.set('user_id', parsed.user_id); // Assuming user_id is in the payload |
NewerOlder