Skip to content

Instantly share code, notes, and snippets.

@smothiki
smothiki / maxsubarray.go
Created September 15, 2021 05:41
maxsubarray
package main
import "fmt"
/*
{
int arr[] = { 2, 3, 4, 5, 7 };
int n = sizeof(arr) / sizeof(arr[0]);
int max_sum = maxSubArraySum(arr, 0, n - 1);
printf("Maximum contiguous sum is %d\n", max_sum);
@smothiki
smothiki / mergesort.go
Last active September 14, 2021 05:23
mergesort.go
package main
import (
"fmt"
)
var inversion int
func merge(arr []int, low, mid,high int){
leftarr:=make([]int,mid-low+1)
@smothiki
smothiki / dind.yaml
Created August 10, 2021 04:00
docker indocker
apiVersion: v1
kind: Pod
metadata:
name: dind
spec:
containers:
- name: dind
image: docker-registry.infra.cloudera.com/smothiki/web:docker
securityContext:
privileged: true
@smothiki
smothiki / imagehandler.go
Created May 27, 2021 22:35
imagehandler.go
kanikoCmdStr := fmt.Sprintf("executor --context %s --dockerfile %s --skip-tls-verify --destination %s",
tmpDir, dockerBuildFile, dockerImageTag)
package imagehandler
import (
"fmt"
"os"
)
RSS(wo,w1)=sigma i=1to N(yi-[w0+w1xi])square
@smothiki
smothiki / main.go
Last active June 1, 2020 19:26
libgit2 sample
package main
import (
"os"
"time"
"fmt"
git "github.com/libgit2/git2go"
)
func credentialsCallback(url string, username string, allowedTypes git.CredType) (git.ErrorCode, *git.Cred) {
https://github.com/adjust/gor/blob/7baf74380087246a9b38848e228817af3463140d/output_http.go#L31
@smothiki
smothiki / tiller-rbac.yml
Created October 25, 2019 00:40
tiller rbac.yml
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: tiller-clusterrolebinding
@smothiki
smothiki / kfctl_aws.yaml
Created October 22, 2019 21:29
kubeflow config
$ cat $CONFIG
apiVersion: kfdef.apps.kubeflow.org/v1alpha1
kind: KfDef
metadata:
name: kubeflow-aws
namespace: kubeflow
spec:
platform: aws
applications:
- kustomizeConfig: