my_project/
build/
deployments/
cmd/
pkg/
README.md
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 groovy | |
| def chngs = "[" | |
| // gather the file changes | |
| def changeSets = currentBuild.changeSets | |
| for (int i = 0; i < changeSets.size(); i++) { | |
| def entries = changeSets[i].items | |
| for (int j = 0; j < entries.length; j++) { | |
| def entry = entries[j] | |
| def files = new ArrayList(entry.affectedFiles) |
hello
world
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 multiprocessing | |
| >>> import random | |
| >>> import time | |
| >>> from threading import current_thread | |
| >>> from rx import Observable | |
| >>> from rx.concurrency import ThreadPoolScheduler | |
| >>> optimal_thread_count = multiprocessing.cpu_count() | |
| >>> pool_scheduler = ThreadPoolScheduler(optimal_thread_count+1) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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: networking.istio.io/v1alpha3 | |
| kind: Gateway | |
| metadata: | |
| name: vapp-gateway | |
| spec: | |
| selector: | |
| istio: ingressgateway | |
| servers: | |
| - port: | |
| number: 80 |
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: config.istio.io/v1alpha2 | |
| kind: listchecker | |
| metadata: | |
| name: whitelist | |
| spec: | |
| # providerUrl: ordinarily black and white lists are maintained | |
| # externally and fetched asynchronously using the providerUrl. | |
| overrides: ["v1", "v2"] # overrides provide a static list | |
| blacklist: false |
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
| podTemplate(label: 'bashpod', containers: [ | |
| containerTemplate(name: 'bash', image: 'bash:latest', ttyEnabled: true) | |
| ]) { | |
| node('bashpod') { | |
| stage('play') { | |
| checkout scm | |
| container('bash') { | |
| print "checking payload" | |
| MAX_MSG_LEN = 100 |
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
| def zipdir(path, ziph): | |
| # ziph is zipfile handle | |
| for root, dirs, files in os.walk(path): | |
| for file in files: | |
| fname = os.path.join(root.replace(APIPROXY_PATH, ''), file) | |
| ziph.write(os.path.join(root, file), fname) | |
| # zip the content | |
| zipf = zipfile.ZipFile('dev.zip', 'w') | |
| zipdir(APIPROXY_PATH, zipf) | |
| zipf.close() |
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
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| int min(int x, int y, int z){ | |
| return min(x, min(y, z)); | |
| } | |
| int max(int x, int y, int z){ | |
| return max(x, max(y, z)); |