Skip to content

Instantly share code, notes, and snippets.

View dtelaroli's full-sized avatar

Denilson Telaroli dtelaroli

View GitHub Profile
@dtelaroli
dtelaroli / pagseguro.rb
Created January 27, 2017 12:48
Configurando API Ruby do Pagseguro por environment
PagSeguro.configure do |config|
configuration = Rails.application.config_for(:pagseguro)
config.email = configuration['email']
config.token = configuration['token']
config.environment = configuration['environment']
config.encoding = configuration['encoding']
end
@dtelaroli
dtelaroli / canvas.txt
Created February 14, 2017 22:30
Resumo canvas
Resumo do video https://www.youtube.com/watch?v=7F3v0BbIkfc
LADO EMOCIONAL (DIREITO)
1. Seguimento de clientes
1.1. Qual é seu público, seguimentado
1.2. Para quem estou criando valor?
1.3. Quem são meus principais clientes?
1.4. Posso agrupá-los e diferenciá-los entre si?
@dtelaroli
dtelaroli / Dockerfile
Last active June 12, 2018 12:25
Docker and docker-compose configuration for rails and mysql
# From one of the official ruby images
FROM ruby:2.4.3
LABEL [email protected]
# Using same user name and id is important to keep same permission between container and local machine
ARG USER
ARG UID
ARG RAILS_ENV
ARG APP_PATH=/var/www
@dtelaroli
dtelaroli / _translations.html.haml
Created June 11, 2018 23:28
Use concern to translate models with globalize
# include this partial inside your form
= f.fields_for :translations do |t|
= t.hidden_field :id
= t.text_field :locale, readonly: true, label: t('label.locale')
= t.text_field :name, required: true, label: t('label.name')
@dtelaroli
dtelaroli / .env
Last active June 29, 2018 16:45
Docker get started with rails, mysql and nginx
APP_PATH=/var/www
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=development
MYSQL_USER=user
MYSQL_PASSWORD=pass
@dtelaroli
dtelaroli / git.sh
Last active August 21, 2022 09:13
Git essentials commands
# Configuration
git config user.name "My Name"
git config user.email "[email protected]"
# Initialize a git repository
git init
# Add all files to be commited
git add .
@dtelaroli
dtelaroli / changes
Created June 19, 2018 19:36
Java configuration to solve error "The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption"
jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
jdk.tls.disabledAlgorithms=SSLv3, RC4, DH keySize < 768
https://stackoverflow.com/questions/14149545/java-security-cert-certificateexception-certificates-does-not-conform-to-algori#
@dtelaroli
dtelaroli / aws_client.php
Last active August 1, 2018 12:05
AWS API Gateway Client Exemple
<?php
/**
*
* Install composer
* curl -sS https://getcomposer.org/installer | php
*
* Download AWS SDK
* php composer.phar require aws/aws-sdk-php
*
* References:
@dtelaroli
dtelaroli / default.conf
Created September 27, 2018 15:08
Nginx php-fpm docker real origin ip
# you may use nginx with real ip module
server {
# your host or vpc cidr_block or the docker gateway address ip
set_real_ip_from 10.0.0.0/24;
real_ip_header X-Forwarded-For;
location ~ \.php$ {
# you should pass the header X-Forwarded-For with the real ip from frontend, the AWS ELB/ALB pass by default
fastcgi_param REMOTE_ADDR $http_x_forwarded_for;
@dtelaroli
dtelaroli / Beans.java
Created October 4, 2018 13:05
Spring Boot, Selenium and ChromeDriver Headless
@Component
public class Beans {
@Bean @RequestScope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public WebDriver webDriver() {
ChromeOptions options = new ChromeOptions()
.addArguments("--no-sandbox")
.setHeadless(true);
ChromeDriver driver = new ChromeDriver(options);