Skip to content

Instantly share code, notes, and snippets.

View hoppergee's full-sized avatar
🏠
Working from home

Hopper Gee hoppergee

🏠
Working from home
View GitHub Profile

Quick Start

sudo curl https://gist.githubusercontent.com/pankaj28843/3ad78df6290b5ba931c1/raw/soffice.sh > /usr/local/bin/soffice && sudo chmod +x /usr/local/bin/soffice

Create an bash script at /usr/local/bin/soffice with following content

#!/bin/bash

# Need to do this because symlink won't work
# Freelancing Reviews Samples
=======================================================================
****
=======================================================================
## Buyer Reviews to Sellers
=======================================================================
@hoppergee
hoppergee / rspec_rails_set_session.md
Created December 10, 2021 17:50 — forked from dteoh/rspec_rails_set_session.md
Setting session variables in an RSpec Rails request spec

Setting session variables in an RSpec Rails request spec

You are writing a spec with type: :request, i.e. an integration spec instead of a controller spec. Integration specs are wrappers around Rails' ActionDispatch::IntegrationTest class. I usually write controller tests using this instead of type: :controller, mainly because it exercises more of the request and response handling stack. So instead of writing something like get :index to start the request, you would write get books_path or similar.

One of the issues with using type: :request is that you lose the ability to

@hoppergee
hoppergee / migration.md
Created April 15, 2020 08:25 — forked from mariochavez/migration.md
RSpec to Minitest

These are the scripts that I used to migrate from RSpec to Minitest in a Rails aplication.

It is expected for the test suite to be in RSpec 3.x sintax.

  1. Install rename library from Homebrew
  2. Remove RSpec/TestUnit from Gemfile
  3. Add minitest-rails gem
  4. Rename spec forder to test
  5. Add a test_helper.rb file
@hoppergee
hoppergee / capybara-selenium-webdriver-slow-speed.md
Created April 15, 2020 05:10 — forked from scmx/capybara-selenium-webdriver-slow-speed.md
Capybara Selenium WebDriver running at a lower speed using sleep command #capybara #selenium #rails #

Capybara Selenium WebDriver running at a lower speed using sleep command

Ever wanted to run your integration/end-to-end test suite at a lower speed so that you better could observe what's happening and perhaps make a recording of it?

Here's a a technique I've been using when writing tests with Capybara Selenium WebDriver.

Put this in test/test_helper.rb or maybe something like spec/support/capybara.rb.

@hoppergee
hoppergee / SSL.md
Created April 8, 2020 03:20 — forked from gangsta/SSL.md
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
@hoppergee
hoppergee / git-commit-word-frequency.sh
Created March 17, 2020 03:19 — forked from jrumbut/git-commit-word-frequency.sh
Find the most frequently used words in your team's commit messages! Woo!
git log --stat | grep "^ " | tr -d '[:punct:]' | tr ' ' '\n' | tr 'A-Z' 'a-z' | sort | uniq -c | sort -rn
abc
@hoppergee
hoppergee / downgrademysql.md
Created March 5, 2019 09:22 — forked from Voronenko/downgrademysql.md
Downgrade mysql to mysql 5.6 on xenial

Install MySQL 5.6 in Ubuntu 16.04

Ubuntu 16.04 only provides packages for MySQL 5.7 which has a range of backwards compatibility issues with code written against older MySQL versions.

Oracle maintains a list of official APT repositories for MySQL 5.6, but those repositories do not yet support Ubuntu 16.04. However, the 15.10 repos will work for 16.04.

Uninstall existing mysql 5.7 if any

sudo apt remove mysql-client mysql-server libmysqlclient-dev mysql-common
@hoppergee
hoppergee / table_steps.rb
Created October 25, 2018 01:53 — forked from garrow/table_steps.rb
Adding a `within_cell` Capybara helper. We use this within our Turnip specs to find a particular cell within a particular column within a table.
def within_cell(row, column)
within_row(row) do
within_column(column) { yield }
end
end
def within_column(column)
# Find the table column offset for the column header, then grab the columns' cells at that offset.
# Adapted from http://stackoverflow.com/questions/14745478
within(:xpath, "//table/tbody/tr/td[count(//table/thead/tr/th[normalize-space()='#{column}']/preceding-sibling::th)+1]") do