Skip to content

Instantly share code, notes, and snippets.

@danielalvarenga
danielalvarenga / go-os-arch.md
Created Oct 20, 2020 — forked from asukakenji/go-os-arch.md
Go (Golang) GOOS and GOARCH
View go-os-arch.md

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.14.7 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • aix
  • android
View mysql2 gem + mariadb + alpine linux.md

mysql2 gem + mariadb + Alpine Linux

tl;dr Use mariadb-dev. In case of Alpine Linux 3.8, 3.9, use mysql2 >= 0.4.10.

Starting with Alpine Linux 3.8 there are basically 2 options to install the mysql2 gem:

1.sh:

@danielalvarenga
danielalvarenga / script-configure-ubuntu20.04-amd64.sh
Last active Oct 2, 2020
Script to consigure new ubuntu instalation
View script-configure-ubuntu20.04-amd64.sh
#!/bin/bash
# Author: Daniel Alvarenga Lima
# Ubuntu version supported: 20.04 LTS amd64
# EXECUTE
# sudo chmod +x script-configure-ubuntu18.94-amd64.sh
# ./script-configure-ubuntu20.04-amd64.sh
#INSTRUCTIONS
@danielalvarenga
danielalvarenga / 01.md
Created Apr 30, 2020 — forked from joshmosh/01.md
Using binary UUIDs with Ruby (on Rails) and MySQL
View 01.md

Binary UUIDs are much more efficient in space and lookups compared to VARCHAR or CHAR UUIDs. To better exmplain how they work I have a few examples of raw sql and how that translates in a programming language like Ruby using the UUID tools module. All examples will reference the following database table and schema.

Table name: users

 id          :uuid(16)
 first_name  :string(255)
 last_name   :string(255)
View gist:129babb555c45a7ec5b772b7b4543482
# Simple approach to sending email from the Rails console
# Implementation idea courtesy of Steve Klabnik
# http://blog.steveklabnik.com/posts/2012-09-09-random-ruby-tricks--class-new
# Create the mailer class with a block and assign to a variable
mailer = Class.new(ActionMailer::Base) do
def example_message
mail(to: "test@test.com", from: "test@test.com", subject: "Example Message") do |format|
format.text { render text: "Example message body" }
end
@danielalvarenga
danielalvarenga / install.sh
Created Sep 30, 2019 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
View install.sh
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
View benchmark if-return-elsif-case.rb
#!/usr/bin/env ruby
require 'benchmark'
MAX = 100000
results = {}
def if_return(attempt)
if attempt == 'primeira'
return 'primeira'
@danielalvarenga
danielalvarenga / script-configure-ubuntu18.94-amd64.sh
Created Jul 17, 2019
Shell script to configure Ubuntu 18.04.
View script-configure-ubuntu18.94-amd64.sh
#!/bin/bash
# Author: Daniel Alvarenga Lima
# Ubuntu version supported: 18.04 LTS 64Bit
# EXECUTE
# sudo chmod +x script-configure-ubuntu18.94-amd64.sh
# ./script-configure-ubuntu18.94-amd64.sh
#INSTRUCTIONS
View languages-abbr.json
{
"Abkhazian": "ab",
"Afar": "aa",
"Afrikaans": "af",
"Akan": "ak",
"Albanian": "sq",
"Amharic": "am",
"Arabic": "ar",
"Arabic (AE)": "ar-ae",
"Arabic (BH)": "ar-bh",
@danielalvarenga
danielalvarenga / alias_matchers.md
Created Jul 17, 2018 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3
View alias_matchers.md

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
You can’t perform that action at this time.