Skip to content

Instantly share code, notes, and snippets.

Kir Shatrov kirs

Block or report user

Report or block kirs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:bc6215a358578d6f4e395a2dcab4ccc5
int deserialize_String_vector(struct iarchive *in, const char *tag, struct String_vector *v)
int rc = 0;
int32_t i;
rc = in->start_vector(in, tag, &v->count);
v->data = calloc(v->count, sizeof(*v->data));
for(i=0;i<v->count;i++) {
rc = rc ? rc : in->deserialize_String(in, "value", &v->data[i]);
rc = in->end_vector(in, tag);
View shopify_deadlines.rb
class Deadline
def self.current=(value)
ActiveRecord::Base.deadline = value
def initialize(duration_seconds)
@deadline = now + duration_seconds.to_i
def extend_deadline(duration_seconds)
View omg.rb
# frozen_string_literal: true
require 'benchmark/ips'
require 'securerandom'
str = "#{SecureRandom.alphanumeric(1000)} SUBSTR"
Benchmark.ips do |x|
x.config(:time => 5, :warmup => 2)"=~") do |t|
100.times do
View omg.rb
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source ""
git_source(:github) { |repo| "{repo}.git" }
gem "rails", github: "rails/rails"
kirs / dance
Last active Jul 6, 2019
Docker snapshot (CRIU) experiments with Rails app and Redmine
View dance
# The script to run actual benchmark
set -e -x
kirs / notes
Created Jun 24, 2019 — forked from justincormack/notes
criu setup Ubuntu 18.04
View notes
apt update
apt upgrade
apt install build-essential
apt install pkg-config
apt install libnet-dev python-yaml libaio-dev
apt install libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libcap-dev python-future
# criu install
curl -O -sSL
tar xjf criu-3.10.tar.bz2
View measure-aws.rb
require 'bundler/inline'
gemfile do
source ''
gem "aws-sdk", "~> 3.0"
require 'aws-sdk'
ec2 = 'us-east-1')
View measure-gcloud.rb
require 'bundler/inline'
gemfile do
source ''
gem 'google-api-client', '~> 0.11'
require 'google/apis/compute_v1'
Google::Apis.logger =
Google::Apis.logger.level = Logger::INFO
View gist:b2cc6aa66874d68e4137470c98e12537
iter = do |yielder|
yielder.yield "start"
3.times { |n| yielder.yield(n) }
yielder.yield "end"
# iter.each do |n|
# puts n
# end
View gist:79f56d9075dc83a06f5f609cc6b40de2
$ curl -v
* Trying
* Connected to ( port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
You can’t perform that action at this time.