Skip to content

Instantly share code, notes, and snippets.

View phildp's full-sized avatar

Filippos Pavlopoulos phildp

View GitHub Profile
@phildp
phildp / battlestation.md
Last active May 30, 2025 16:48
Starship config

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@phildp
phildp / goroutines_for_wg_ch.go
Last active April 16, 2020 11:03
Goroutines in loop with wait group and channels
import (
"errors"
"strconv"
"sync"
)
// ConcAtoI converst each element of a string slice to number concurrently.
// If some element cannot be converted, the functions exits and return the error.
// The function uses waitgroup, done and error channels.
func ConcAtoI(a []string) error {
@phildp
phildp / goroutines_for_mutex_wg_ch.go
Last active April 16, 2020 11:02
Goroutines in loop with mutex, wait group and channels
import (
"errors"
"strconv"
"sync"
)
// ConcSumAtoI calculates the numerical sum of a given slice of strings concurrently.
// If some element cannot be converted to numeric, the function exits and returns the error.
// The function uses waitgroup, done and error channels and a mutex for the sum.
func ConcSumAtoI(a []string) (*int, error) {