Skip to content

Instantly share code, notes, and snippets.

Rafael Izidoro rizidoro

Block or report user

Report or block rizidoro

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
@rizidoro
rizidoro / sidekiq.config
Created Jul 25, 2019 — forked from ssaunier/sidekiq.config
Running Sidekiq on AWS Elastic Beanstalk (Put that file in `.ebextensions` folder)
View sidekiq.config
# Sidekiq interaction and startup script
commands:
create_post_dir:
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
owner: root
group: root
@rizidoro
rizidoro / uuid.sql
Created Jul 22, 2019
Mysql bin_to_uuid & uuid_to_bin
View uuid.sql
DELIMITER |
CREATE FUNCTION bin_to_uuid(b BINARY(16))
RETURNS CHAR(36) DETERMINISTIC
BEGIN
DECLARE HEX CHAR(32);
SET HEX = HEX(b);
RETURN LOWER(CONCAT(LEFT(HEX, 8), '-', MID(HEX, 9,4), '-', MID(HEX, 13,4), '-', MID(HEX, 17,4), '-', RIGHT(HEX, 12)));
END
|
@rizidoro
rizidoro / Makefile
Created Jan 14, 2018 — forked from istepanov/Makefile
Makefile for deploying Python 3 AWS Lambda
View Makefile
PROJECT = myProject
FUNCTION = $(PROJECT)
REGION = us-west-1
ENVCHAIN = my-aws-env
all: build
.PHONY: clean build deploy
clean:
View Banks
'001' => 'BANCO DO BRASIL S.A.',
'003' => 'BANCO DA AMAZONIA S.A.',
'004' => 'BANCO DO NORDESTE DO BRASIL S.A.',
'012' => 'BANCO STANDARD DE INVESTIMENTOS S.A.',
'014' => 'NATIXIS BRASIL S.A.',
'019' => 'BANCO AZTECA DO BRASIL S.A.',
'021' => 'BANESTES S.A. BANCO DO ESTADO DO ESPIRITO SANTO',
'024' => 'BANCO DE PERNAMBUCO S.A. - BANDEPE',
'025' => 'BANCO ALFA S.A.',
'029' => 'BANCO BANERJ S.A.',
@rizidoro
rizidoro / rails http status codes
Created Mar 8, 2016 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
View rails http status codes
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
View post-checkout
#!/usr/bin/env ruby
def rebuild_config_files
root_repo_dir = `git rev-parse --show-toplevel`.chomp
change_branch = '1'
if ARGV[2] == change_branch
puts 'Rebuilding config files...'
`#{root_repo_dir}/scripts/bootstrap_configs`
end
end
@rizidoro
rizidoro / history.txt
Last active Oct 2, 2015 — forked from unak/history.txt
The History of Ruby
View history.txt
* Only the releases of the stable versions are enumerated in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable."
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion.
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also emurated. About the venues of such conferences, general English notations are adopted, in my hope.
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release becaouse of an accident.
* 1.2.1 release was canceled once, and the 2nd repelase called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular.
* Since 1.0 was released with the date in large quantities
View clear_untracked_branchs.sh
#!/bin/bash
# Removel all local branchs whitch there is no link with remote repository.
# Take care! It can remove branchs you have created but yet haven't linked with a remote branch.
function clear_untracked_branchs {
if [ -d "$(pwd)/.git" ]; then
git pull
git remote update origin --prune
git branch | grep -v 'master' | grep -v '*' | sort | while read -r branch ; do
if [ !$(git branch -r --list *$branch) ] ; then
View 00.howto_install_phantomjs.md

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
You can’t perform that action at this time.