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
package main
import "fmt"
type material func(x, y int) int
func main() {
var explosion material = func(elemX, elemY int) int {
return elemX + elemY
}
@monkrus
monkrus / Interface
Last active December 9, 2021 03:12
Simplified explanation of interface in Golang
package main
import (
"fmt"
)
// INTERFACE IS A ACTION
type marathon interface {
satisfaction() int
}
package main
import (
"fmt"
)
func numberDoor(number int) {
func() {
fmt.Println(number)
package solution
func Solution (A []int, K int) []int {
if len(A) <= 1 || K == 0 {
return A
}
for i := 0; i < K; i++ {
A = append(A[len(A)-1:], A[:len(A)-1]...)
var cheerio = require('cheerio');
const $ = cheerio.load('<ul class="cards-wrapper">...</ul>');
$.html();
pm.test('Page title should be set', function () {
$('.cards-wrapper').text("640-660");
});
var cheerio = require('cheerio');
const $ = cheerio.load(pm.response.text());
pm.test('Page title should be set', function () {
pm.expect($('title').text()).to.equal('Snapshot');
pm.expect($(''))
});
pm.test('Page should have header and footer tags', function () {
pm.expect($('header')).to.exist;
pm.expect($('footer')).to.exist;
@monkrus
monkrus / Go Type assertions
Created June 12, 2020 21:57
Type Assertions
package main
import "fmt"
type Developer interface {
Develop()
}
type FrontEnd struct {
Name string
@monkrus
monkrus / Go
Last active June 6, 2020 23:10
package main
import (
"fmt"
"github.com/streadway/amqp"
)
func main() {
fmt.Println("Consumer Application")
@monkrus
monkrus / Go
Last active June 6, 2020 23:09
package main
import (
"fmt"
"github.com/streadway/amqp"
)
func main() {
fmt.Println("Go RabbitMQ Tutorial")
package main
import (
"fmt"
"github.com/streadway/amqp"
)
func main() {
fmt.Println("Go RabbitMQ Tutorial")
conn, err := ampq.Dial("ampq://guest:guest@localhost:5672/")
if err != nil {
fmt.Println(err)