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
alias k='kubectl' | |
alias kg='k get' | |
alias kgp='kg pod' | |
alias kd='k describe' | |
alias kdp='kd pod' | |
alias kD='k delete --force --grace-period=0' | |
alias kDp='kD pod' | |
alias kc='k create' |
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
// This class makes an HTTP GET request to canvas API and inserts the data received from canvas API in salesforce | |
// create a class which can be called on a schedule | |
global class FinalTCS implements Schedulable, Database.AllowsCallouts{ | |
public void execute(SchedulableContext SC) { | |
callWebService(); | |
} | |
@future(callout=true) | |
public static void callWebService() { | |
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
# change <repo> with name of your actual repo | |
test: # run make setup before this | |
@echo *************Running tests*************; \ | |
source .venv/bin/activate; \ | |
pytest --junitxml htmlcov/codecov-results.xml --cov . --cov-config test/.coveragerc --cov-report html --cov-report xml | |
lint: # run make setup before this | |
@echo *************Running lint*************; \ | |
source .venv/bin/activate; \ | |
pylint <repo>/ |
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
static_resources: | |
listeners: | |
- name: listener_0 | |
address: | |
socket_address: | |
address: 0.0.0.0 | |
port_value: 10000 | |
filter_chains: | |
- filters: |
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
admin: | |
access_log_path: /tmp/admin_access.log | |
address: | |
socket_address: | |
address: 127.0.0.1 | |
protocol: TCP | |
port_value: 9901 | |
static_resources: | |
listeners: | |
- name: listener_0 |
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
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
type IComponent interface { | |
Show() error | |
Delete() error |
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
type IReader interface { | |
Read() error | |
} | |
type Reader struct { | |
} | |
// Read always throws error | |
func (r Reader) Read() error { | |
return fmt.Errorf("error in read") |
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
func Retry(ctx context.Context, f RetryFunc, retryAttempts int) error { | |
var err error | |
for i := 0; i < retryAttempts; i++ { | |
select { | |
case <-ctx.Done(): | |
return ctx.Err() | |
default: | |
} | |
err := f() | |
if err == nil { |
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
type ReaderRetryDecorator struct { | |
reader IReader | |
} | |
func (d ReaderRetryDecorator) ReadWithRetry(ctx context.Context, retryAttempts int) error { | |
var err error | |
for i := 0; i < retryAttempts; i++ { | |
select { | |
case <-ctx.Done(): | |
return ctx.Err() |
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
type ReaderRetryDecorator struct { | |
retryAttempts int | |
reader IReader | |
} | |
func (d ReaderRetryDecorator) Read() error { | |
var err error | |
for i := 0; i < d.retryAttempts; i++ { | |
err := d.reader.Read() | |
if err == nil { |
OlderNewer