This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Install latest ruby from brightbox with gems | |
# | |
# tested on precise version, and brightbox ruby-1.9.1 package ready for: | |
# precise(12.04) | |
# | |
# run this script on your ubuntu ~> | |
# `https://gist.githubusercontent.com/RunsFor/7af723f4dea1b73cfce9/raw | sudo bash` | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
puts(Benchmark.measure do | |
count = 0 | |
400_000_000.times do | |
count += 1 | |
end | |
end) | |
puts(Benchmark.measure do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
objects = nil | |
puts(Benchmark.measure do | |
objects = 100_000.times.map { Object.new } | |
block = proc { nil } | |
objects.each { |obj| obj.define_singleton_method(:test_me, &block) } | |
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //') | |
if [ $BRANCH_NAME != '(no branch)' ] | |
then | |
# создаем временный файл | |
tempname="ticket-id-XXXX"; | |
tempfile=`mktemp $tempname`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone git@github.com:tarantool/graphql.git | |
Cloning into 'graphql'... | |
remote: Enumerating objects: 125, done. | |
remote: Counting objects: 100% (125/125), done. | |
remote: Compressing objects: 100% (36/36), done. | |
remote: Total 2642 (delta 97), reused 99 (delta 89), pack-reused 2517 | |
Receiving objects: 100% (2642/2642), 1.30 MiB | 407.00 KiB/s, done. | |
Resolving deltas: 100% (1996/1996), done. | |
$ cd graphql | |
$ git show e4f77a257e0e77a65992b21c9547529e6b80f78d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 8; | |
error_log logs/error.log info; | |
events { | |
worker_connections 4096; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
access_log off; | |
sendfile on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
box.cfg{} | |
statuses = { 'sent', 'delivered' } | |
uuid = require('uuid') | |
clock = require('clock') | |
box.schema.create_space('fragments') | |
box.space.fragments:create_index('pk') | |
box.space.fragments:create_index('status', { unique = false, parts = {{3, 'string', is_nullable = true}}}) | |
for i =1,500000,1 do box.space.fragments:insert({i,uuid.str(), statuses[math.random(0,2)]}) end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tarantool 2.1.1-434-g881c7b59b | |
type 'help' for interactive help | |
tarantool> socket = require('socket') | |
--- | |
... | |
tarantool> fiber = require'fiber' | |
--- | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tarantool 2.1.1-434-g881c7b59b | |
type 'help' for interactive help | |
tarantool> kafka = require'kafka' | |
--- | |
... | |
tarantool> consumer, err = kafka.Consumer.create({ | |
> brokers = 'localhost:9292', -- brokers for bootstrap | |
> options = { | |
> ["enable.auto.offset.store"] = "true", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env tarantool | |
local socket = require('socket') | |
local log = require('log') | |
local vars = {} | |
local function smtp_server(s) | |
s:write('220 localhost ESMTP Tarantool\r\n') | |
local l |