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 vault_client | |
import ( | |
"context" | |
"log" | |
"time" | |
"github.com/hashicorp/vault/api" | |
) |
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
// BatchProcessor processes a collection of items in batches using goroutines. | |
func BatchProcessor(items []int, processFunc func([]int) int, batchSize int) <-chan int { | |
var wg sync.WaitGroup | |
// Create a channel with a buffer size of the batch size. | |
ch := make(chan []int, batchSize) | |
// Create a channel to receive the results returned by the Process function. | |
results := make(chan int) |
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 ( | |
"context" | |
"fmt" | |
"time" | |
) | |
func WorkHardOne(ctx context.Context, name string, res *chan string) { | |
for sec := 0; sec < 3; sec++ { |
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
-- DDL Statement -- | |
create table users( | |
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, | |
full_name varchar(100) | |
); | |
insert into users(full_name) | |
VALUES | |
('Manju Desappa'), |
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" | |
"math" | |
) | |
func main() { | |
// Find the definition after main | |
tracker := WellfordVariance{} |
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
#!/bin/bash -e | |
docker run --name ldap-service --hostname ldap-service -p 389:389 -p 636:636 --detach osixia/openldap:1.1.8 | |
docker run --name phpldapadmin-service --hostname phpldapadmin-service -p 6443:443 --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.9.0 | |
PHPLDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" phpldapadmin-service) | |
echo "Go to: https://$PHPLDAP_IP" | |
echo "Login DN: cn=admin,dc=example,dc=org" | |
echo "Password: admin" |
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
#!/usr/bin/python | |
import requests | |
import sys | |
import json | |
GITHUB_ENDPOINT = "https://api.github.com" | |
GIHUB_API_KEY = "84b84ed3699ff6d54c11171edc2f57fd25a9a71f" | |
# Print helper for the script | |
print("\n||| Some Github Shit |||\n") |
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" | |
"github.com/gocarina/gocsv" | |
) | |
/* users.csv |
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" | |
const DEBUG bool = true | |
type Leaf struct { | |
value int | |
left *Leaf | |
right *Leaf |
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" | |
"sync" | |
) | |
type Fork struct{ id int } | |
type Philo struct { |
NewerOlder