Skip to content

Instantly share code, notes, and snippets.

View monopolly's full-sized avatar

Fullstack Engineer monopolly

  • San Francisco, CA
View GitHub Profile
@monopolly
monopolly / moveupslice.go
Last active November 3, 2017 09:04
Move up slice element, golang
//find "up" in slice and move it to begin of slice
func upslice(f *[]uint32, up uint32) {
if len((*f)) == 0 || (*f)[0] == up {
return
}
if (*f)[len(*f)-1] == up {
(*f) = append([]uint32{up}, (*f)[:len(*f)-1]...)
return
}
package main
import (
"github.com/tarantool/go-tarantool"
"gopkg.in/vmihailenco/msgpack.v2"
)
type AccountExample struct {
//magic here
#!/usr/bin/tarantool
------------------------------------- Импортируем встроенные библиотеки ------------------------------------------
json = require('json')
yaml = require('yaml')
fiber = require('fiber')
msgpack = require('msgpack')
-------------------------------------------------- Конфиг базы ------------------------------------------------------