Skip to content

Instantly share code, notes, and snippets.

@ddadlani
ddadlani / channel_concurrency.go
Created July 15, 2020 20:05
Example for multiple producers and consumers for a channel
package main
import (
"fmt"
"sync"
)
func main() {
eventBus := make(chan string)
@ddadlani
ddadlani / config.fish
Created July 22, 2019 21:07
Custom Fish Functions
# custom functions
function set_booklit
fly -t dev login -u test -p test -c http://localhost:8080
fly -t dev sp -p booklit -c (echo "\
resources:
- name: booklit
type: git
source: {uri: "https://github.com/vito/booklit"}
jobs:
@ddadlani
ddadlani / example.go
Created July 4, 2019 19:02
Channel testing example
func CallerMethod() {
events := make(chan string)
go func() {
Callee(events)
}()
select {
case msg := <-events:
fmt.Println(msg)
}
}
@ddadlani
ddadlani / setbooklit.sh
Created April 3, 2019 19:03
A script to quickly set a test concourse pipeline
#!/bin/bash
fly -t dev login -c http://localhost:8080 -u test -p test
cat << EOF > /tmp/booklit
resources:
- name: booklit
type: git
source: {uri: "https://github.com/vito/booklit"}
jobs:
@ddadlani
ddadlani / docker-compose-two-atcs.yml
Last active February 7, 2019 20:56
nginx config for two ATCs with docker-compose
version: '3'
services:
db:
image: postgres
ports:
- 6543:5432
environment:
POSTGRES_DB: concourse
POSTGRES_USER: dev