Skip to content

Instantly share code, notes, and snippets.

View davydovanton's full-sized avatar
:shipit:
Working from home

Anton Davydov davydovanton

:shipit:
Working from home
View GitHub Profile

Давай представим ситуацию, когда тебе, в зависимости от какой-то логики нужно вернуть данные разного типа, например есть такая функция:

def function(foo, bar)
  result = if foo > bar
    10
  else
    "wrong"
  end
end
@davydovanton
davydovanton / release_en.md
Last active January 16, 2017 11:38
OSSBoard release

Have you ever wanted to begin OpenSource development, but just couldn’t get down to it? Or maybe you already have a project, but don’t have enough time and effort to support it?

Here at OSS Board we collect tasks that are waiting for their heroes.

How?

The two following projects inspired me to create OSS Board:

@davydovanton
davydovanton / release_ru.md
Created December 28, 2016 15:30
OSSBoard release

Вы давно хотите заняться OpenSource разработкой, но никак не доходят руки?
У вас есть свой проект, но не хватает сил и времени на его поддержку?

На [OSS Board] (http://www.ossboard.org) мы собираем задачи, которые ждут своих героев.

How?

На создание OSS Board меня вдохновили два проекта.

Keybase proof

I hereby claim:

  • I am davydovanton on github.
  • I am davydovanton (https://keybase.io/davydovanton) on keybase.
  • I have a public key whose fingerprint is CA89 031E B23A AEEC 7DE0 3D85 9C52 8790 DD09 852A

To claim this, I am signing this object:

@davydovanton
davydovanton / talks.md
Created December 13, 2016 20:36 — forked from melekes/talks.md
The list of my favorite talks.

Results

Benchmark

Before

              schema#call:   127822.5 i/s
          permissive#call:   121042.7 i/s - same-ish: difference falls within error
strict_with_defaults#call:    82149.2 i/s - 1.56x  slower
              strict#call:    73719.1 i/s - 1.73x  slower
                weak#call:    70113.8 i/s - 1.82x  slower
@davydovanton
davydovanton / config.ru
Created September 24, 2016 21:30 — forked from homakov/config.ru
config.ru
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
#prevents DNS rebinding attacks
class DNSBinding
VALID_HOSTS = %w{localhost:9292 myshop.dev:3000 myshopprod.com}
def initialize(app)
@app = app
end
@davydovanton
davydovanton / GIF-Screencast-OSX.md
Created August 21, 2016 15:06 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@davydovanton
davydovanton / rdrc2016.md
Created July 9, 2016 09:37 — forked from cheeaun/rdrc2016.md
RedDotRubyConf 2016 links & resources 😘
@davydovanton
davydovanton / regex_interpolation.rb
Created July 9, 2016 08:00
Benchmark: regex interpolation
require 'benchmark/ips'
GITHUB_COM = %r{https?://(?:www\.)?github\.com}i
Benchmark.ips do |x|
x.report('with o') { %r{\A#{GITHUB_COM}/([^/]+)/?\z}o }
x.report('without o') { %r{\A#{GITHUB_COM}/([^/]+)/?\z} }
x.compare!
end