Skip to content

Instantly share code, notes, and snippets.

View djalmaaraujo's full-sized avatar
🌊
Working from home

Djalma Araújo de Andrade djalmaaraujo

🌊
Working from home
View GitHub Profile
@djalmaaraujo
djalmaaraujo / setup_railson_mac_m1.md
Created May 25, 2023 14:31 — forked from dereknguyen269/setup_railson_mac_m1.md
Setup project rails 4.2.x and ruby 2.5.x on Mac M1

I've some problem when setup project with:

  • Rails 4.2.10
  • Ruby 2.5.3
  • Postgresql 13

My steps:

Install Homebrew

# Retorna dados sobre o pregão
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDados.asp?CodDado=IBOV,ticker&CA=undefined
# Retorna ações e seus últimos valores negociados
http://www.bmfbovespa.com.br/Pregao-OnLine/ExecutaAcaoCarregarDados.asp?CodDado=Ticker
# Retorna o histórico do dia de um papel
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDadosPapeis.asp?CodDado=petr4
# Retorna dados de um papel
@djalmaaraujo
djalmaaraujo / nightmare-on-amazon-linux.MD
Created June 4, 2018 23:54 — forked from dimkir/nightmare-on-amazon-linux.MD
How to run nightmare on Amazon Linux

Running nightmare on Amazon Linux

You may have thought of running nightmare on AWS Lambda. But before we can run it on Lambda, we need first to make it run on Amazon Linux.

Provision instance which replicates Lambda environment

According to AWS Documentation on Lambda Execution Environment and available Libraries we would need this AMI image with this alias amzn-ami-hvm-2016.03.3.x86_64-gp2. Keep in mind that AMI-image-id for this instance would be different in different regions (eg):

  • In eu-west-1 - ami-f9dd458a
  • In us-east-1 - ami-6869aa05
@djalmaaraujo
djalmaaraujo / gist:8cc6bbeb61755bbe76d19ccaf62fff0a
Created November 22, 2016 01:59 — forked from sowenjub/gist:1033876
Quickly dump your heroku production database and load it locally
#!/bin/bash
# This script does the following:
# 1/ capture and download the latest backup
# 2/ load it to your local database
# 3/ run your app and open Safari
# Just replace any uppercase string with your own data
#
@djalmaaraujo
djalmaaraujo / xip
Created August 12, 2013 19:26 — forked from wilkerlucio/gist:6214088
xip.io
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 8acc96c..ae5bbb0 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -122,8 +122,9 @@ class ApplicationController < ActionController::Base
end
def store_subdomain
- @store_domain ||= request.subdomain.blank? ?
- 'www' : request.subdomains.last