Skip to content

Instantly share code, notes, and snippets.

View RunsFor's full-sized avatar
🎯

Ilya Konyukhov RunsFor

🎯
View GitHub Profile
@RunsFor
RunsFor / nginx.conf
Last active December 11, 2025 12:19
HTTP terminating tools comparison in tarantool (MacBook Pro 13 2017 3.5 Ghz Intel Core i7, 16GB)
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;
@RunsFor
RunsFor / git-clone-graphql.txt
Created February 22, 2019 13:25
git show failed on a healthy commit
$ 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
@RunsFor
RunsFor / commit-msg.example
Last active August 15, 2016 09:48
Git commit hook to extract issue id from the branch name and prefix commit message with it
#!/bin/bash
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
if [ $BRANCH_NAME != '(no branch)' ]
then
# создаем временный файл
tempname="ticket-id-XXXX";
tempfile=`mktemp $tempname`;
@RunsFor
RunsFor / define_singleton_method_jruby.rb
Last active February 1, 2016 22:04
jruby perform too slow comparing to mri
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)
@RunsFor
RunsFor / multithreaded.rb
Last active February 1, 2016 22:28
Multithreaded script performs slower than singlethreaded
require 'benchmark'
puts(Benchmark.measure do
count = 0
400_000_000.times do
count += 1
end
end)
puts(Benchmark.measure do
@RunsFor
RunsFor / install.sh
Last active August 29, 2015 14:17 — forked from sletix/install.sh
#!/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`
#
[79] pry(main)> time = Time.zone.now
=> Thu, 12 Feb 2015 11:05:54 MSK +03:00
[80] pry(main)> time.to_f
=> 1423728354.07368
[81] pry(main)> user.update_attribute(:updated_at, time)
=> true
[82] pry(main)> user.updated_at.to_f
=> 1423728354.07368
[83] pry(main)> user.reload.updated_at.to_f
=> 1423728354.073
@RunsFor
RunsFor / docker-logstash.conf
Last active August 29, 2015 14:10
logstash configuration for debugging
input { stdin { type => "stdin-type"} }
output { stdout { codec => rubydebug } }
@RunsFor
RunsFor / the_ruby_racer_install.sh
Created March 26, 2014 06:10
Install new version of therubyracer on mac os x
brew tap homebrew/dupes # Thanks Tom
brew install apple-gcc42
export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2
brew uninstall v8
gem uninstall libv8
@RunsFor
RunsFor / outdated.txt
Created January 20, 2014 14:51
bundle outdated
Outdated gems included in the bundle:
* bootstrap-sass (3.0.3.0 > 2.3.2.2) Gemfile specifies "~> 2.2"
* capistrano (3.1.0 > 2.15.5) Gemfile specifies "~> 2.15.5"
* capybara (2.2.1 > 1.1.4) Gemfile specifies "~> 1.1.3"
* client_side_validations-simple_form (2.1.0 > 2.0.1)
* coffee-rails (4.0.1 > 3.2.2)
* cucumber (1.3.10 > 1.3.6) Gemfile specifies "= 1.3.6"
* devise (3.2.2 > 3.0.4) Gemfile specifies "~> 3.0.2"
* execjs (2.0.2 > 1.4.0) Gemfile specifies "~> 1.4.0"
* faraday (0.9.0 > 0.8.9)