Skip to content

Instantly share code, notes, and snippets.

View jonasporto's full-sized avatar
⌨️
Working and having fun!

Jonas Porto jonasporto

⌨️
Working and having fun!
  • Rio de Janeiro, Brazil
View GitHub Profile
@jonasporto
jonasporto / download_pages.rb
Created February 17, 2019 19:24 — forked from justinxreese/download_pages.rb
Limit open threads in ruby
# Pretty simple solution to harness the capability of multithreading without running into problems
# caused by doing too many things at once.
# In this example, I was trying to download hundreds of web pages, but opening all those connections
# simultaneously caused a variety of errors
# Contains download_link(link,save_dir,save_name) to download and save webpages locally (irrelevant)
require 'download_page'
# keep the threads in here

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

@jonasporto
jonasporto / README-Template.md
Created November 12, 2018 21:07 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

mysql> select @@GLOBAL.sql_mode;
+--------------------------------------------+
| @@GLOBAL.sql_mode |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)
mysql> SET @@GLOBAL.sql_mode=''
-> ;
let element = document.querySelector('#auto-complete');
let uri = 'https://example.org/search';
let choice = new Choices(element, {
removeItemButton: false,
itemSelectText: '',
shouldSort: false,
});
let timer = null;
choice.passedElement.addEventListener('search', function (event) {
@jonasporto
jonasporto / ruby_rails_windows.md
Created May 3, 2018 12:00 — forked from KelseyDH/ruby_rails_windows.md
Ruby on Rails Microsoft Windows Troubleshooting Tips

Ruby on Rails Windows Troubleshooting Tips & Survival Guide

Intro/Overview

The Ruby on Rails Windows Troubleshooting tips & Survival Guide is a random catalogue of issues I faced working with Ruby on Rails on Windows (Windows 7 specifically). This guide is not exhaustive, but covers many of the challenges that causes Windows Ruby developers to jump ship to Linux or Mac. If you're reading this guide then you're probably new to Ruby/Rails, so also included is more general beginner advice to help you get going.

Personal Side Note

Before you follow this guide, I strongly recommend you consider using Linux or Mac OS X for Ruby Development instead. Looking to prove a point as a challenge, I ignored this strongly given advice while learning Ruby/Rails. While I eventually did succeed in getting Ruby on Rails to work in Windows, it was not easy, and I easily lost 40+ hours on StackOverFlow to Windows/Ruby configuration issues--time I could have devoted to learning more about th

@jonasporto
jonasporto / _readme.md
Created April 24, 2018 15:02 — forked from diegoos/_readme.md
Script to deploy gh-pages for Vue (Webpack) projects

Setup

Copy the deploy.sh on root of your project.

Deploy

Just run ./deploy.sh

@jonasporto
jonasporto / _readme.md
Created April 24, 2018 15:02 — forked from diegoos/_readme.md
Script to deploy gh-pages for Vue (Webpack) projects

Setup

Copy the deploy.sh on root of your project.

Deploy

Just run ./deploy.sh

@jonasporto
jonasporto / capybara cheat sheet
Created April 22, 2018 15:02 — forked from zhengjia/capybara cheat sheet
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')
@jonasporto
jonasporto / capybara.md
Created April 22, 2018 15:00 — forked from steveclarke/capybara.md
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)