Skip to content

Instantly share code, notes, and snippets.

Andrii Savchenko Ptico

  • Aejis
  • Kyiv, Ukraine
Block or report user

Report or block Ptico

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 ref.rb
class Ref
class << self
def [](name)
self.new(name)
end
end
def initialize(name)
@name = name
end
View bench.rb
require 'benchmark'
require 'benchmark/ips'
require 'benchmark/memory'
require 'faker'
class Bench
attr_reader :benchmarks
attr_accessor :bmbm_iters
@Ptico
Ptico / problem.rb
Last active Oct 22, 2019
dry-schema partial
View problem.rb
AddressSchema = Dry::Schema.Params do
required(:street).filled(:string)
required(:city).filled(:string)
required(:zipcode).filled(:string)
required(:email).filled(:string)
end
# ...
# CREATE { street: 'Baker Street', city: 'London', zipcode: 'NW1/W1', email: 'sherlock@holmes.co.uk' }
View inflector.rb
class Parts
def initialize(parts)
@parts = parts
end
def join(part_divider, word_divider='')
@parts.map do |word|
word.join(word_divider)
end.join(part_divider)
end
@Ptico
Ptico / .babelrc
Last active Jun 22, 2016
Hanami gulp assets with digests
View .babelrc
{
"plugins":
[
"transform-undefined-to-void",
"transform-es2015-arrow-functions",
"transform-es2015-block-scoping",
"transform-es2015-block-scoped-functions",
"transform-es2015-constants",
"transform-es2015-destructuring",
"transform-es2015-parameters",
View keybase.md

Keybase proof

I hereby claim:

  • I am ptico on github.
  • I am ptico (https://keybase.io/ptico) on keybase.
  • I have a public key ASD84JPGkyH33x0DJUEohQ0xz_lTuCLfGUu9cIAdS9XoIgo

To claim this, I am signing this object:

@Ptico
Ptico / gems.rb
Created Oct 6, 2015
My default rails gemfile
View gems.rb
source 'https://rubygems.org'
BUNDLE_RAILS_VERSION = '~> 4.2.4'
# Rails
gem 'railties', BUNDLE_RAILS_VERSION
gem 'activesupport', BUNDLE_RAILS_VERSION
gem 'actionpack', BUNDLE_RAILS_VERSION
gem 'actionmailer', BUNDLE_RAILS_VERSION
gem 'activejob', BUNDLE_RAILS_VERSION
@Ptico
Ptico / site.conf
Created Oct 1, 2015 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on https://terrty.net/2014/ssl-tls-in-nginx/
View site.conf
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null
@Ptico
Ptico / SassMeister-input.scss
Last active Aug 29, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
.pretty-form {
input {
&[type="text"], &[type="password"], &[type="email"], &[type="url"], &[type="month"], &[type="number"], &[type="search"], &[type="tel"], &[type="week"] {
&:invalid, .invalid & {
color: red;
}
@Ptico
Ptico / 1_instructions.md
Created Jun 18, 2015
Список журналажи и тотальной зрады (пополняется)
View 1_instructions.md

Следуя данной инструкции вы избавитесь от паники, тотальной зрады, а так же улучшите настроение и аппетит.

Если у вас windows 8 и выше

  1. Читаете как править файл hosts здесь: http://skesov.ru/kak-izmenit-fayl-hosts-na-windows-8-1-ili-8/
  2. Вставляете в конец файла записи из списка ниже
  3. Сохраняете

Если у вас MacOS X или Linux

You can’t perform that action at this time.