Skip to content

Instantly share code, notes, and snippets.

View themarcelor's full-sized avatar
🎓
crescat scientia, vita excolatur

Marcelo R Costa themarcelor

🎓
crescat scientia, vita excolatur
View GitHub Profile
@themarcelor
themarcelor / list_service_accounts.js
Created December 13, 2019 01:40
test script to list the Service Accounts from a given Google Cloud Platform project
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,
@themarcelor
themarcelor / eslint-my-js
Created December 16, 2019 18:56
Simple ELISP after-save-hook to run a JS linter every time some test script is saved.
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
;; run eslint-diff when saving executable tests
(defun eslint-my-js ()
(interactive)
"check if the code is cool when saving a JS file."
(when (eq major-mode 'js-mode)
(with-output-to-temp-buffer "*js-lint-issues*"
; (message "file name: %s" buffer-file-name)))
(shell-command (format "/usr/local/bin/npx eslint %s" buffer-file-name)
@themarcelor
themarcelor / waitWaitWait.js
Last active January 14, 2020 20:40
Little test
function sleepMS(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
};
async function add (x, y) {
await sleepMS(2000);
return x + y
}
(async () => {
{"openapi":"3.0.2","info":{"title":"DCFS Metadata Service","version":"1.2.0a0"},"paths":{"/version":{"get":{"summary":"Get Version","operationId":"get_version_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/_status":{"get":{"summary":"Get Status","operationId":"get_status__status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/metadata_index":{"get":{"tags":["Index"],"summary":"List Metadata Indexes","description":"List all the metadata key paths indexed in the database.","operationId":"list_metadata_indexes_metadata_index_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBasic":[]}]}},"/metadata_index/{path}":{"post":{"tags":["Index"],"summary":"Create Metadata Indexes","description":"Create a database index on the given metadata key path.","operationId":"create_metadata_indexes_metadata_index__path_
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: release-tracker-deployment
spec:
selector:
# Only select pods based on the 'app' label
matchLabels:
app: release-tracker
revisionHistoryLimit: 2
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: acronymbot-deployment
spec:
selector:
# Only select pods based on the 'app' label
matchLabels:
app: acronymbot
revisionHistoryLimit: 2
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: qabot-deployment
spec:
selector:
# Only select pods based on the 'app' label
matchLabels:
app: qabot
revisionHistoryLimit: 2
import argparse
import os
import sys
import sys
import logging
import asyncio
from gen3.index import Gen3Index
from gen3.tools import indexing
>>> secs_array = []
>>> my_secs = ['1s', '5s']
>>> for i in range(0,50):
... secs_array.append(my_secs[i % 2])
...
>>> for x in range(0, 50):
... print("{" + " \"duration\": \"{}\", \"target\": {} ".format(secs_array[x], x) + "}")
...