Skip to content

Instantly share code, notes, and snippets.

View lanastasov's full-sized avatar
🎯
Focusing

Lubomir Anastasov lanastasov

🎯
Focusing
  • Bulgaria
  • 01:53 (UTC +03:00)
View GitHub Profile
@JekaMas
JekaMas / main.go
Created August 31, 2017 16:10
Golang slice flatten
package main
import (
"errors"
"fmt"
)
func Flatten(arr interface{}) ([]int, error) {
return doFlatten([]int{}, arr)
}
@khajavi
khajavi / DuckTypingExample.go
Created December 24, 2016 11:19
Duck Typing Example in Golang
package main
import "fmt"
type Speaker interface {
Say(string)
}
type Person struct {
@teddyking
teddyking / waitgroup.go
Created August 23, 2016 10:34
Example of Go sync.WaitGroup
package main
import (
"fmt"
"sync"
"time"
)
func main() {
var myWaitGroup sync.WaitGroup
@josephspurrier
josephspurrier / values_pointers.go
Last active April 28, 2024 16:41
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@philippbayer
philippbayer / natural_sort.go
Last active June 30, 2019 18:00
A perverted kind of natural sort in golang
package main
import (
"fmt"
"log"
"sort"
"strconv"
"strings"
"unicode"
)
@aubricus
aubricus / create-new-file.ahk
Created August 16, 2011 00:00
AutoHotkey script to create a new file.
; create new file
; installation:
; 1. you must be running autohotkey: http://www.autohotkey.com
; 2. double click on script to run
; [pro-tip] add this script to your startup folder to run when windows start
; [pro-top] you can add this script to another .ahk script file.
; hotkey is set to control + alt + n
; more on hotkeys: http://www.autohotkey.com/docs/Hotkeys.htm