Skip to content

Instantly share code, notes, and snippets.

View VishDev12's full-sized avatar
👋
🚀

Vishnu Deva VishDev12

👋
🚀
View GitHub Profile
@VishDev12
VishDev12 / Pseudocode
Created February 13, 2018 17:17
Sequential Programming
image = download (imagePath);
processedImage = process (image);
upload (processedImage);
text = download (textPath);
processedText = process (text);
upload (processedText);
@VishDev12
VishDev12 / NS-Pseudocode
Last active February 14, 2018 16:21
Non-Sequential Programming
download1 (imgPath, processImage, uploadImage); //processImage and uploadImage are callback functions
download2 (txtPath, processText, uploadText); //processText and uploadText are callback functions
@VishDev12
VishDev12 / Callback
Last active February 14, 2018 10:25
firstThis (data, callBack){
data = 1
callBack (data)
}
firstThis (x, anyFunction);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@VishDev12
VishDev12 / gh-actions-costs.csv
Last active July 29, 2022 18:36
Compares the compute costs of Github Actions with AWS.
Provider Type Cost ($/hr) Compute
Github Actions NA 0.48 2 CPUs & 7 GB
AWS On Demand 0.101 2 CPUs & 8 GB (m5.large)
AWS Spot (cheap compute) 0.0202 2 CPUs & 8 GB (m5.large)
@VishDev12
VishDev12 / general-runner.yaml
Last active July 30, 2022 07:12
Captures the two components needed for a runner using ARC.
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: general-runner
namespace: actions-runner-system
spec:
template:
spec:
metadata:
labels:
@VishDev12
VishDev12 / prepull.pkr.hcl
Last active October 12, 2022 07:55
A Packer script to build EKS AMIs with Container Images baked in.
packer {
required_plugins {
amazon = {
version = ">= 0.0.2"
source = "github.com/hashicorp/amazon"
}
}
}
variable "IMAGE" {
@VishDev12
VishDev12 / nerdctl-script.sh
Last active October 16, 2022 04:51
Uses nerdctl to pull an Image to the machine.
# Install the ECR Credential Helper that automatically authenticates with ECR.
sudo yum install amazon-ecr-credential-helper -y
# Configure Docker to use the credential helper.
mkdir ~/.docker/
cat > ~/.docker/config.json << EOF
{
"credsStore": "ecr-login"
}
EOF
@VishDev12
VishDev12 / docker-script.sh
Created October 12, 2022 15:31
Uses Docker to pull an Image to the machine.
# Install the ECR Credential Helper that automatically authenticates with ECR.
sudo yum install amazon-ecr-credential-helper -y
# Configure Docker to use the credential helper.
mkdir ~/.docker/
cat > ~/.docker/config.json << EOF
{
"credsStore": "ecr-login"
}
EOF