Skip to content

Instantly share code, notes, and snippets.

View andboson's full-sized avatar
🌴

Andrii Bosonchenko andboson

🌴
  • Cherkasy, UKR \ Alicante, SP
View GitHub Profile
@andboson
andboson / sample-js-web-sock
Created December 1, 2016 18:18
min js-web-socket
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div class="tabs">
<ul>
<li v-for="int in 2" class="ui-tabs-tab ui-corner-top ui-state-default ui-tab"
v-bind:class="[ picked == $index ? 'ui-state-active' : '']">
<label class="ui-tabs-anchor">Tab-${ $index }
<input type="radio" name="tabs" value="${ $index }" v-model="picked" v-show="false">
</label>
</li>
</ul>
<div v-for="w_type in wizard_types" v-show="( picked == $index )">
insert into questions(article, name, email, text, hash, sale_location_id, created_at, updated_at ) select 1111111 as article, 'drew' as name, 'i@s.com' as email, md5(generate_series(1,10)::text) as text, md5(generate_series(1,10)::text) as hash, 'shop_r002' as sale_location_id, to_date(now()::text, 'YYYY-MM-DD HH:MI:SS') as created_at, to_date(now()::text, 'YYYY-MM-DD HH:MI:SS') as updated_at;
@andboson
andboson / gist:49a7e6b1fdd57389d261
Last active August 29, 2015 14:24
singleton pattern in go
package singleton
import (
"sync"
)
//http://marcio.io/2015/07/singleton-pattern-in-go/
type singleton struct {
}
type FFiltersController struct {
Request *http.Request
Response http.ResponseWriter
}
type inputRequest struct {
Id int `json:"id"`
Url string `json:"url"`
SaleLocationId string `json:"sale_location_id"`
Categories []string `json:"categories"`
'{"url":"/lg-active3D-smart-tv"}'
@andboson
andboson / main.go
Created May 5, 2015 15:10
Beego different configs
............
//another config placed in conf/prod/app.conf
func Init() { //old init()
//something like init database
}
func main() {
if beego.RunMode == "dev" {
siege -c15 -r2 'http://localhost:8000/api/v1/user_channel.get_sale_location POST {"session_id":"8888888888888", "channel":"MM", "sale_location_id":"shop"}'
$file = file($usersFile->getPathname());
$header = str_getcsv(array_shift($file));
$usersArray = array_map(function ($line) use ($header) {
$row = str_getcsv($line);
return (object)array_combine($header, $row);
}, $file);
@andboson
andboson / docker works
Last active August 29, 2015 14:13
docker create image manual
sudo docker run -t -i ubuntu:12.04
>do something
Ctrl-p + Ctrl-q
sudo docker ps -a
sudo docker commit 123432423 andboson/ubuntu:12.04.dev
sudo docker images
sudo docker run -t -i andboson/ubuntu:12.04.dev /bin/bash
>do something
Ctrl-p + Ctrl-q
sudo docker ps -a