Skip to content

Instantly share code, notes, and snippets.

🌺

Phil Pirozhkov pirj

🌺
Block or report user

Report or block pirj

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
@pirj
pirj / time_freezer.rb
Created Feb 18, 2016
Allow Capybara to walk hand in hand with freezed time
View time_freezer.rb
# Due to Capybara's intolerance to tools that freeze time
# (specifically Time.now), we only freeze Time.current here
# @param time [Time] Time. But may be anything else if you like
# @example
# TimeFreezer.freeze_current_time('lol') do
# Time.current #=> lol
# Time.now #=> Your system time
# end
# Time.current #=> Your time with respect to Time.zone
#
View ruby-block-sugar.asciidoc

You won’t find rants on how functional programming improves you, your sanity and your life overall here. There are some examples in the very beginning to save you some time on reading the whole post, just come along if you don’t like how they look like.

By the way, this is not even a blog, so formally this is not even a blog post. This is not a library or a new paradigm. It’s just a few pieces of code that might come handy for your daily job.

Example:

[1, 3.14, -4].map &_.safe{ magnitude odd? } # => [true, nil, false]
@pirj
pirj / git.md
Last active Mar 15, 2016
Git with ease
View git.md

Below is a Git usage proposal I compiled to make everyone's live easier

Reason

Our repo is flooded with merge commits, and as team and topic branch number grows, this is going to grow like a snowball and prevail over regular commits (it already does by the way)

Rationale

Keep flat history Pull requests are always up to date with master

@pirj
pirj / locate.rb
Last active Feb 9, 2016
Locate those annoying MESSages during tests
View locate.rb
# Put this in your test helper
# Use `caller` to locate where in code that BUGGER is
class IO
BUGGER = /annoying/
def print *args
binding.pry if args.any? { |arg| arg =~ BUGGER }
super *args
end
def puts *args
@pirj
pirj / app.rb
Created Oct 24, 2014
Padrino::CanCan example that is known to have worked years ago
View app.rb
class App < Padrino::Application
register Padrino::Mailer
register Padrino::Helpers
register Padrino::Admin::AccessControl
register Padrino::Rendering
set :session_secret, "blah"
set :sessions, true
[403, 404, 405, 500].each do |code|
@pirj
pirj / CV.md
Last active Aug 22, 2019
Curriculum vitae
View CV.md

Personal summary

Name: Filipp Pirozhkov

Age: 40

Located in: Somewhere traveling

Top engineer with proven ability to develop efficient solutions to complex problems. Extensive experience and skills with all levels of software and architecture.

@pirj
pirj / index.html
Created Apr 29, 2014
Пишем HTTP proxy сервер с плагинами / Хабрахабр
View index.html
<!DOCTYPE html>
<!-- saved from url=(0032)http://habrahabr.ru/post/111569/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width = 1080">
<title>Пишем HTTP proxy сервер с плагинами / Хабрахабр</title>
@pirj
pirj / index.html
Created Apr 29, 2014
Необычные клавиатуры для программистов и не только / Хабрахабр
View index.html
<!DOCTYPE html>
<!-- saved from url=(0032)http://habrahabr.ru/post/145084/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width = 1080">
<title>Необычные клавиатуры для программистов и не только / Хабрахабр</title>
@pirj
pirj / index.html
Created Apr 29, 2014
Неназойливые регистрация и вход на сайт / Хабрахабр
View index.html
<!DOCTYPE html>
<!-- saved from url=(0032)http://habrahabr.ru/post/138538/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width = 1080">
<title>Неназойливые регистрация и вход на сайт / Хабрахабр</title>
@pirj
pirj / index.html
Created Apr 29, 2014
Интерфейсель: Запутанная история / Хабрахабр
View index.html
<!DOCTYPE html>
<!-- saved from url=(0032)http://habrahabr.ru/post/145944/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width = 1080">
<title>Интерфейсель: Запутанная история / Хабрахабр</title>
You can’t perform that action at this time.