Skip to content

Instantly share code, notes, and snippets.

View index0h's full-sized avatar

Roman Levishchenko index0h

View GitHub Profile
@index0h
index0h / statsd_feeding.sh
Last active February 28, 2019 09:17
statsd_feeding.sh
#!/bin/sh
METRIC_NAME='test.metric'
STATSD_HOST='statsd.host'
STATSD_PORT='8125'
DELAY_MCS=100000
# "c" - counter, will aggregate as sum
# "t" - timer, will aggregate as avg
# "g" - gauge, will aggregate as last
AGGREGATION="c"
@index0h
index0h / permissions.sql
Last active February 11, 2019 14:27
permissions.sql
CREATE TABLE IF NOT EXISTS `gallery` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`galleryId` INT UNSIGNED NOT NULL,
`createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`name` VARCHAR(64) NULL,
PRIMARY KEY (`id`),
KEY `galleryId` (`galleryId`)
)
ENGINE = InnoDB
DEFAULT CHARSET = `utf8`;
@index0h
index0h / .gitattributes
Created February 6, 2019 12:02
.gitattributes
*.php text eol=lf
*.js text eol=lf
*.sh text eol=lf
*.sql text eol=lf
*.svg text eol=lf
*.pug text eol=lf
*.json text eol=lf
@index0h
index0h / iframe.go
Created October 31, 2018 23:04
iframe.go
package main
import (
"fmt"
"github.com/nareix/joy4/av"
"github.com/nareix/joy4/av/avutil"
"github.com/nareix/joy4/av/pubsub"
"github.com/nareix/joy4/format"
"github.com/nareix/joy4/format/flv"
"github.com/nareix/joy4/format/rtmp"
@index0h
index0h / StrictMethodsConstraint.php
Created June 4, 2018 10:08
StrictMethodsConstraint.php
<?php
declare(strict_types = 1);
namespace My\Vendor\PhpUnitStrict;
use PHPUnit\Framework\Constraint\Constraint;
use PHPUnit\Framework\MockObject\InvocationMocker;
use PHPUnit\Framework\MockObject\Matcher;
use PHPUnit\Framework\MockObject\MockObject;
@index0h
index0h / .vimrc
Created August 22, 2017 08:38
Centos basic image
if has("syntax")
syntax on
endif
if has('mouse')
set mouse=r
endif
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
@index0h
index0h / service_example.go
Created June 30, 2017 11:04
service_example.go
package main
type MyService struct {
dbConnection *sql.DB
logger log.Logger
service1 *Service1
service2 *Service2
}
func NewMyService(
@index0h
index0h / goSort.go
Created May 30, 2017 18:58
go vs node
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"sort"
"time"
)
@index0h
index0h / TypedArrayCollection.php
Created January 24, 2017 14:03
TypedArrayCollection.php
<?php
class TypedArrayCollection
{
/** @var string */
private $class;
/** @var object[] */
private $array;
@index0h
index0h / examlpe.sh
Created December 30, 2016 16:51
example goroutine
index0h@home-pc:/tmp$ cat test.go
package main
import (
"fmt"
"time"
)
func pinger(c chan string) {
for i := 0; ; i++ {