Skip to content

Instantly share code, notes, and snippets.

@oleggator
oleggator / t_set.go
Last active March 2, 2019 17:48
Set storage in KV
package ledis
import (
"encoding/binary"
"errors"
"time"
"github.com/siddontang/ledisdb/store"
)
@oleggator
oleggator / .zshrc
Created December 23, 2018 20:54
grml's zsh setup
# Filename: /etc/zsh/zshrc
# Purpose: config file for zsh (z shell)
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
################################################################################
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
@oleggator
oleggator / model.json
Created December 7, 2018 12:33
Kapua simulator model
{
"applications": {
"example1": {
"scheduler": { "period": 2000 },
"topics": {
"t1/data": {
"positionGenerator": "spos",
"metrics": {
"temp1": { "generator": "sine1", "name": "value" },
"temp2": { "generator": "sine2", "name": "value" }
@oleggator
oleggator / ideas.md
Last active August 20, 2018 10:13
Идеи для проекта
@oleggator
oleggator / Wallet.java
Last active December 22, 2017 14:31
Перевод денег с счета на счет
import java.util.concurrent.atomic.AtomicLong;
public class Wallet {
static final AtomicLong lastId = new AtomicLong(0);
private final long id = lastId.incrementAndGet();
private Long cash;
public Wallet(long initCashAmount) {
cash = initCashAmount;
ab -n 5000 -c 500 -H "X-User-Token: b6iqm6krn5vm6j6ko04g" https://tgcs.utkin.xyz/api/v1/images.get
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking tgcs.utkin.xyz (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=cache:30m max_size=1G;
proxy_temp_path /tmp 1 2;
proxy_ignore_headers Expires Cache-Control;
proxy_cache_use_stale error timeout invalid_header http_502;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name tgcs.utkin.xyz;
return 301 https://$host$request_uri;
// Example
ca := clarifaiApi.NewClarifaiApi("d13e1bf06c404473be5ec9481eae9f5e")
images := []string{
"http://i.imgur.com/lxFmo5S.jpg",
"http://i.imgur.com/Y5d5M8D.jpg",
}
result, err := ca.RecognizeImages(images, 0)
if err != nil {
fmt.Println(err)
}
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "PreferencesController.h"
int main(int argc, char *argv[]){
QGuiApplication app(argc, argv);
app.setQuitOnLastWindowClosed(false);