Skip to content

Instantly share code, notes, and snippets.

View adis-io's full-sized avatar

Adis Osmonov adis-io

View GitHub Profile

Debug

---
- name: Prepare server(s)
  hosts: servers
  gather_facts: False
  tasks:
    - debug:
        msg: "wut"

Keybase proof

I hereby claim:

  • I am adis-io on github.
  • I am adiso (https://keybase.io/adiso) on keybase.
  • I have a public key ASD8EXUCFkqysD2V3MsYAfgXQ4WKQgZh_TXL0K62XSk0pAo

To claim this, I am signing this object:

@adis-io
adis-io / fork_break_usage_example.rb
Created December 12, 2017 16:29
github.com/forkbreak/fork_break - usage example
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
@adis-io
adis-io / README
Last active August 15, 2017 08:50
Производительность использования текстового и UUID типа в postgres
Запуск тестов:
~ createdb text_vs_uuid
~ ruby text_vs_uuid.rb
Тесты:
MacBook i7 16 GB:
== WITHOUT INDEX ==
NOTICE: extension "uuid-ossp" already exists, skipping
@adis-io
adis-io / text_vs_uuid.rb
Created August 15, 2017 08:37
~ createdb text_vs_uuid
begin
require 'pg'
require 'benchmark'
rescue LoadError
$stderr.puts "You don't have gem pg installed in your system. Please use `gem install pg` to install it"
raise
end
class TextVSUUID
DB_NAME = 'text_vs_uuid'
@adis-io
adis-io / json_api_client_vs_her_rb.md
Last active April 22, 2017 08:48
JsonApiClient vs Her Rb for using with json_api

JsonApiClient

Pros

Cons

Her Rb

Pros

@adis-io
adis-io / config.ru
Created January 25, 2017 06:10 — forked from Epictetus/config.ru
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
require "rails"
# Let's load only action controller. If you want
# to use active record, just require it as well.
require "action_controller/railtie"
class MyApp < Rails::Application
#!/bin/sh
set -e
cmd="$@"
bundle check || bundle install
exec $cmd
require 'rack'
require 'thin'
# Mock server for testing bad or heavyweight server responses; runs on localhost:4000 by default
#
# Example of use
#
# In setup method:
#
# @mock_server = MockServer.new # creating a new instance spawns a thread running the TCP server