Skip to content

Instantly share code, notes, and snippets.

View alispat's full-sized avatar
🎯
Focusing

Alisson Patrick alispat

🎯
Focusing
View GitHub Profile
@alispat
alispat / RAILS_CHEATSHEET.md
Created February 28, 2023 17:42 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

//PRA PEGAR O EMAIL E O TOKEN PRA SE AUTENTICAR NA API DO PAGSEGURO VC PRECISA IR NO PAINEL LA DO SANDBOX, NO MENU LATERAL NA ESQUERDA
// EM PERFIS DE INTEGRAÇÃO/VENDEDOR AI OS DADOS ESTAO NO INICIO DA PAGINA EM VENDEDOR DE TESTES;
//O PROCESSO DESCRITO ACIMA SÓ TE DA O EMAIL E O TOKEN DO AMBIENTE DE TESTE(SANDBOX), PRA PEGAR O EMAIL E O TOKEN DE PRODUÇÃO VOCE
//PRECISA LOGAR NA SUA CONTA DO PAGSEGURO FORA DO SANDBOX pagseguro.uol.com.br-> ACESSAR MINHA CONTA,
// NO MENU LATERAL NA ESQUERDA IR EM APLICAÇOES/MINHAS APLICAÇOES E CLICAR EM CRIAR NOVA APLICAÇÃO, AI VC PREENCHE TUDO QUE ELES PEDEM //QUE É OBRIGATORIO, DEPOIS VÁ EM PREFERENCIAS/INTEGRAÇÕES NO MENU LATERAL E EM UTILIZAÇÃO DE API CLIQUE EM GERAR UM TOKEN QUE VOCE VAI //USAR NO METODO INICIAR COM O EMAIL DA SUA CONTA DO PAGSEGURO QUE É O MESMO EMAIL USADO NO SANDBOX, EM PRODUÇÃO SO ALTERNE OS TOKENS;
//ABAIXO DOS IMPORTS
@alispat
alispat / nginx.conf
Created February 24, 2023 21:40 — forked from denji/nginx.conf
jefftk.com nginx.conf
# for debugging with valgrind
#daemon off;
#master_process off;
#user nobody;
worker_processes 1;
worker_rlimit_core 500M;
working_directory /tmp/nginx_cores/;
@alispat
alispat / .git-commit-template
Created May 4, 2021 20:10 — forked from zakkak/.git-commit-template
This commit message template that helps you write great commit messages and enforce it across your team.
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char)
# |<---- Preferably using up to 50 chars --->|<------------------->|
# Example:
# [feat] Implement automated commit messages
# (Optional) Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# (Optional) Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@alispat
alispat / mysql2-catalina.md
Created February 24, 2021 15:20 — forked from fernandoaleman/mysql2-catalina.md
Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Catalina with MySQL 5.7.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>
@alispat
alispat / chromeinstall_ubu16.sh
Created April 28, 2020 02:09 — forked from LoganGray/chromeinstall_ubu16.sh
this worked to install selenium and google chrome on my Ubuntu 16 server.
#!/usr/bin/env bash
# used to install offical chrome and selenium on Ubuntu 16.04.1 LTS, 18.04 desktop, Jan 2020
# also tested and works on Elem OS 5.1 :)
cd ~
sudo apt-get update
sudo apt install python-pip
pip install simplejson
pip install bs4
pip install selenium
apt-get install libasound2 libnspr4 libnss3 libxss1 xdg-utils unzip

Nginx and Puma for Ruby on Rails

When a lot of people are working on the same Rails application, than Vagrant could help to set up environment quick and easy. Even Vagrant is not recommended for production, it is very usefull for testing deployment script. For production we can simply copy deployment script and run manually.

We can deploy Ruby on Rails app using a quick way to deploy ruby on rails on vagrant.

@alispat
alispat / bash_profile.md
Created April 8, 2019 12:58 — forked from ankurk91/bash_profile.md
:octocat: Git branch name in Linux/Mac Terminal

Mac OS : Show your git branch name on your terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@alispat
alispat / Campaign Budget Overspend Monitoring
Created January 14, 2019 22:01 — forked from BrainlabsDigital/Campaign Budget Overspend Monitoring
Labels (and optionally pauses) campaigns that are overspending too much, and emails you a warning.
/**
*
* Campaign Budget Overspend Monitoring
*
* This script labels campaigns whose spend today is more than their daily
* budgets. Optionally, it also pauses campaigns whose spend exceeds the
* budget by too much. An email is then sent, listing the newly labelled
* and paused campaigns.
* When spend no longer exceeds budget, the campaigns are reactivated and
* labels are removed.