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
// benchmark various json parsing and querying libraries on the use case of finding the image of the first container of a Kubernetes Pod | |
package jsonbench | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"testing" | |
"github.com/Jeffail/gabs/v2" | |
"github.com/itchyny/gojq" |
This file has been truncated, but you can view the full file.
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
/tmp/python-build.20200602081612.15621 ~/.asdf/plugins/python/pyenv | |
/tmp/python-build.20200602081612.15621/Python-3.8.3 /tmp/python-build.20200602081612.15621 ~/.asdf/plugins/python/pyenv | |
checking build system type... x86_64-pc-linux-gnu | |
checking host system type... x86_64-pc-linux-gnu | |
checking for python3.8... no | |
checking for python3... python3 | |
checking for --enable-universalsdk... no | |
checking for --with-universal-archs... no | |
checking MACHDEP... "linux" |
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
b64contents = $(shell base64 -w 0 myfile) | |
build: | |
go build -ldflags "-X main.myfile=$(b64contents)" |
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
build: | |
go generate | |
go build |
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
from pyspark.sql import SparkSession | |
spark = SparkSession \ | |
.builder \ | |
.appName("spark-avro-json-sample") \ | |
.config('spark.hadoop.avro.mapred.ignore.inputs.without.extension', 'false') \ | |
.getOrCreate() | |
#storage->avro | |
avroDf = spark.read.format("com.databricks.spark.avro").load(in_path) |
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
kubectl get po mypod -ojson | jq '.status.conditions[] | select(.type=="mycondition") | .status' -r |
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
(ResourceGroup=<ResourceGroupName>) (Resource=<ResourceName>) (ActivityStatus=Succeeded) | |
| Sort TimeGenerated asc | |
| Top 1 | |
| Select Caller |
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
var aadTenant = "yourTenant.onmicrosoft.com", | |
spaClientId = "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", //AAD app client id for this app | |
serviceClientId = "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", //AAD app client id for the service API app | |
var serviceUrl = "http://localhost:8081/api/doSomething"; // the service API endpoint | |
var authContext = new AuthenticationContext({ | |
instance: 'https://login.microsoftonline.com/', | |
tenant: aadTenant, | |
clientId: spaClientId, | |
postLogoutRedirectUri: window.location.origin, |
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 os | |
import azure.batch.batch_service_client as batch | |
import azure.batch.batch_auth as batchauth | |
import azure.batch.models as batchmodels | |
#---------------------parameters---------------------# | |
#--------------this is the part you edit-------------# | |
batch_account_name = "<your batch account name here>" | |
batch_account_url = "<your batch account url here>" |
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
//demonstrates how to submit multiple http requests, while making sure each is resilient to transient errors using retries | |
var Promise = require('bluebird'); | |
var rp = require('request-promise'); | |
var retry = require('bluebird-retry'); | |
var createPromise = function(i) { | |
return retry(function () { | |
return rp('http://localhost:8000?q='+i).promise(); | |
}, { |