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 {google} = require('googleapis'); | |
| var iam = google.iam('v1'); | |
| authorize(function(authClient) { | |
| var request = { | |
| // Required. The resource name of the project associated with the service | |
| // accounts, such as `projects/my-project-123`. | |
| name: 'projects/my-project-123/serviceAccounts', // TODO: Update placeholder value. | |
| auth: authClient, |
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
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| name: allure-deployment | |
| labels: | |
| app: allure | |
| spec: | |
| selector: | |
| # Only select pods based on the 'app' label | |
| matchLabels: |
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
| Feature('This is a just a test'); | |
| const readline = require("readline"); | |
| const fenceProps = require('../../services/apis/fence/fenceProps.js'); | |
| const chai = require('chai'); | |
| const {interactive, ifInteractive} = require('../../utils/interactive.js'); | |
| const { Gen3Response, getAccessTokenHeader } = require('../../utils/apiUtil'); | |
| const expect = chai.expect; | |
| // this should be included in the core lib |
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
| function get_api_key_and_then_the_access_token() { | |
| return new Promise(async(resolve) => { | |
| const get_resp = await pm.sendRequest({ | |
| url: 'http://localhost:8000/credentials.json' | |
| }, | |
| function (err, response) { | |
| //console.log('req_resp: ' + response.json()['api_key']); | |
| resolve(get_access_token(response.json()['api_key'], | |
| pm.environment.get('TARGET_ENVIRONMENT'))); | |
| }); |
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
| % cat test.yaml | grep -B1 " config_helper" | tr " " "*" | |
| **************mountPath:*"/var/www/sheepdog/config_helper.py" | |
| **************subPath:*config_helper.py** | |
| % yamlfmt test.yaml -w | |
| % cat test.yaml | grep -B1 " config_helper" | tr " " "*" | |
| **********mountPath:*/var/www/sheepdog/config_helper.py | |
| **********subPath:*config_helper.py |
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
| array = [[1,2,[3]],4] | |
| def unpack(arr, flatten = []): | |
| for i in arr: | |
| if isinstance(i, list): | |
| unpack(i, flatten) | |
| else: | |
| flatten.append(i) | |
| return flatten |
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 scala.util.control.Breaks._ | |
| object DetectPrime { | |
| def isPrime(num: Int):Boolean = { | |
| if (num == 1) { | |
| false | |
| } else if (num == 2) { | |
| true | |
| } else { |
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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "time" | |
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
| "k8s.io/client-go/kubernetes" | |
| "k8s.io/client-go/pkg/api" |
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
| # easy | |
| docker stop $(docker ps -a -q) | |
| docker rm $(docker ps -a -q) | |
| # meh | |
| # docker ps -a | tail -n +2 | awk '{print $1}' | xargs -I {} docker rm {} |
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
| ############ User input for AWS Access key and AWS Secret key | |
| echo "Please provide your S3 Access Key: " | |
| read -s AWSID | |
| echo "Please provide your S3 Secret key:" | |
| read -s AWSSEC | |
| calculate_signature () { | |
| AWSSEC=$1 | |
| x_amz_date_short=$2 |