Skip to content

Instantly share code, notes, and snippets.

View monkrus's full-sized avatar
🌊
AI Engineer

Sergei Stadnik monkrus

🌊
AI Engineer
View GitHub Profile
@monkrus
monkrus / 0_reuse_code.js
Created April 5, 2017 12:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am monkrus on github.
  • I am monkrus (https://keybase.io/monkrus) on keybase.
  • I have a public key ASCLQYvA2oqUovYRGXLlGLL-uahxP0xJgeicNpFvhV6QrQo

To claim this, I am signing this object:

package main
import (
"fmt"
)
func main() {
b := Bird{}
b.Gender ="male"
b.Name = "Emu"
@monkrus
monkrus / Nested loop
Last active January 10, 2020 21:05
Nested loop in go
package main
import (
"fmt"
)
func main() {
Loop:
for i := 1; i <= 3; i++ {
@monkrus
monkrus / Underscore operator
Created January 11, 2020 00:28
Getting partial value with underscore operator
package main
import (
"fmt"
)
func main() {
statePopulations := map[string]int{
"California": 39250017,
@monkrus
monkrus / Building HTTP services
Created January 11, 2020 02:34
Go HTTP services
package main
import (
"fmt"
"html/template"
"net/http"
"time"
)
type Welcome struct {
@monkrus
monkrus / HTTP services in Go
Created January 11, 2020 03:54
Steps to set HTTP services in Go
package main
import (
"fmt"
"net/http"
)
func main() {
//step 2
http.HandleFunc("/", foo)
@monkrus
monkrus / Method in Go
Created January 13, 2020 19:24
Method in Go
package main
import (
"fmt"
)
type person struct {
first string
last string
}
@monkrus
monkrus / Return function
Created January 13, 2020 23:43
Return function in Go
package main
import (
"fmt"
)
func main() {
x := bar()
fmt.Printf("%T\n", x)
/
@monkrus
monkrus / Go closure explained
Created January 14, 2020 15:18
Incrementor in Go
package main
import (
"fmt"
)
func main() {
a := incrementor()
b := incrementor()
fmt.Println(a())