Skip to content

Instantly share code, notes, and snippets.


Filip Bartuzi Bartuz

View GitHub Profile
Bartuz / component.jsx
Last active Jul 7, 2020
helper to test How to unit test Reaptcha invisible recaptcha google jest enzyme
View component.jsx
const Component = ({ onSuccess, onError, onExpire }) => {
const recapchaRef = useRef(null);
return (
onRender={() => recapchaRef.current.execute()}
View test.rb
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
gemfile(true) do
source ""
# Activate the gem you are reporting the issue against.
Bartuz / .Title
Created Jun 2, 2017 — forked from congjf/.Title
Using MongoDB in golang with mgo
View .Title
Using MongoDB in golang with mgo
View gist:122b8992ee714eb872e013bd847b6de0
1. Usuniesz klucz z web appki phraseappa
2. $ yarn phraseapp:push
3. Klucz pojawia sie ponownie we phareappie
Jeśli <— Prawdiłowe flow
1. Usuniesz klucz z phraseappa
2. $ yarn phraseapp:pull
3. $ yarn phraseapp:push
4. klucz znika z plików .json i z web appki phraseappa
View service.rb
def initialize(options = {})
@type = options.fetch(:destination_type) { CARD_TO_CARD }
@options = options
def initialize(destination_type: CARD_TO_CARD, **options)
@type = destination_type
@options = options

Keybase proof

I hereby claim:

  • I am bartuz on github.
  • I am fbartuzi ( on keybase.
  • I have a public key whose fingerprint is 3434 16BB 7526 A36F 7B75 0DF1 22A4 EBE5 92DE FB89

To claim this, I am signing this object:

Bartuz / bench.rb
Created Jan 25, 2016 — forked from paneq/bench.rb
cost of using exceptions for control flow compared to one SQL statement (ruby 2.1.4, rails 4.1.7, sqlite) for . Development mode executed in rails console.
View bench.rb
require 'benchmark'
ActiveRecord::Base.logger = nil
Benchmark.bmbm do |bench|"SQL query") do
1000.times { Whatever.count }
end"exception hit") do
Bartuz /
Created Dec 9, 2015 — forked from da4nik/
Change standart rails confirm dialog to custom
Set custom options:
= link_to talk, method: :delete, class: 'icon-close', data: {confirm: "Вы действительно хотите удалить всю переписку с данным пользователем?", confirm_options: {title: 'Удалить все сообщения', yes: 'Да', no: 'Нифига'}}, remote: true
or standart rails way
= link_to talk, method: :delete, class: 'icon-close', data: {confirm: "Вы действительно хотите удалить всю переписку с данным пользователем?"}, remote: true
View z2.rb
class BinaryTree
attr_accessor :root
def initialize
@root =
def insert(letter, path)
node = root
path.each_char do |direction|
View checkout_controller.rb
def checkout
cart =, params)
redirect_to cart_path, notice: t('.success')
redirect_to cart_path, notice: t('.failure', reason: cart.error_message)