Skip to content

Instantly share code, notes, and snippets.

View vorandrew's full-sized avatar

Andrew Vorobyov vorandrew

View GitHub Profile
@vorandrew
vorandrew / bitbucket-pipelines.yml
Created October 29, 2023 11:11 — forked from ahmetgeymen/bitbucket-pipelines.yml
Bitbucket Pipelines: Build Docker Image + GCR Image Push + GKE Deploy
image: openjdk:11-jdk-slim
definitions:
caches:
gradlewrapper: ~/.gradle/wrapper
gke-kubectl-pipe: &pipe atlassian/google-gke-kubectl-run:1.3.1
gke-kubectl-pipe-variables: &pipe-variables
KEY_FILE: $GKE_API_KEYFILE
PROJECT: $GCP_PROJECT_ID
COMPUTE_ZONE: $GKE_COMPUTE_ZONE
package pubsub
import (
"context"
"testing"
"time"
"cloud.google.com/go/pubsub"
"cloud.google.com/go/pubsub/pstest"
"google.golang.org/api/option"
@vorandrew
vorandrew / benchmark-commands.md
Created November 29, 2020 21:13 — forked from ueokande/benchmark-commands.md
Kafka Benchmark Commands

Benchmark commands

Producer

Setup

bin/kafka-topics.sh \
  --zookeeper zookeeper.example.com:2181 \
  --create \
@vorandrew
vorandrew / server.r
Last active January 5, 2019 14:00 — forked from timelyportfolio/server.r
Example to Test Parameters on Moving Average System
#almost entirely based on the 02_text and 03_mpg examples provided by RStudio Shiny
#all credit belongs to them
if (!require(PerformanceAnalytics)) {
stop("This app requires the PerformanceAnalytics package. To install it, run 'install.packages(\"PerformanceAnalytics\")'.\n")
}
if (!require(quantmod)) {
stop("This app requires the quantmod package. To install it, run 'install.packages(\"quantmod\")'.\n")
@vorandrew
vorandrew / protips.js
Created October 27, 2015 07:33 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@vorandrew
vorandrew / blackscholes.js
Created September 4, 2012 16:44 — forked from joaojeronimo/blackscholes.js
Black-Scholes in Javascript: A rewrite of http://www.espenhaug.com/black_scholes.html
/*
PutCallFlag: Either "put" or "call"
S: Stock Price
X: Strike Price
T: Time to expiration (in years)
r: Risk-free rate
v: Volatility
This is the same one found in http://www.espenhaug.com/black_scholes.html
but written with proper indentation and a === instead of == because it's