Skip to content

Instantly share code, notes, and snippets.

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

Talles Airan tallesairan

🏠
Working from home
View GitHub Profile
@tallesairan
tallesairan / url_slug.php
Created April 15, 2021 19:52 — forked from sgmurphy/url_slug.php
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@tallesairan
tallesairan / README.md
Created February 8, 2021 16:03
Tabela de erros MercadoPago em php/javascript

Tabela de erros mercadopago em php e javascript

simple mercadopago error handling in pt_BR

  • php usage getMpErrorCode('209');
  • js usage getMpErrorCode(209);
@tallesairan
tallesairan / README.md
Last active February 3, 2021 14:22
Pixel facebook para domínios confirmados

Facebook Pixel Para domínios confirmados

Guia simples para implementação dessa nova estratégia.

Após uma mudança recente o facebook infelizmente só passou a aceitar  eventos de domínios confirmados

Como instalar o código do pixel ?

  • 1 Passo
@tallesairan
tallesairan / cpmove-multiples-users.sh
Created January 29, 2021 16:54
Create cpmove with array of users
usernames=('usr1' 'usr2')
for i in ${usernames[*]}; do /scripts/pkgacct $i; done;

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@tallesairan
tallesairan / deploy-keys.md
Created November 30, 2020 15:19 — forked from holmberd/deploy-keys.md
Setup GitHub repository SSH deploy keys

Setup GitHub repository SSH deploy keys

  1. Create GitHub repository in github and save the SSH repository url

  2. Init git on server in code directory

  • git init
  1. Create SSH keys on the server
  • ssh-keygen -t rsa -b 4096 -C your@email.here
  • Rename the key that doesn't end with .pub to repo-name.deploy.pem
@tallesairan
tallesairan / README.md
Last active October 28, 2020 18:20
Install certbot and generate certificate

apt-get update

apt-get install python-minimal

python --version

apt-get install git-core

git --version

@tallesairan
tallesairan / sendy.nginx.conf
Created October 1, 2020 15:40
sendy nginx rules
# nginx configuration by winginx.com
location / {
if ($script_filename !~ "-d"){
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php break;
}
}
location /l {
rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 break;
public class ATM
{
private boolean userAuthenticated;
private int currentAccountNumber;
private Screen screen;
private Keypad keypad;
private CashDispenser cashDispenser;
private DepositSlot depositSlot;
private BankDatabase bankDatabase;
@tallesairan
tallesairan / mysqlSync.sh
Created June 15, 2020 05:36
Mysql sync local to remote server
#!/bin/bash
# Remote DB credentials
LOCAL_USER=######
LOCAL_PASS=######
LOCAL_HOST=####
LOCAL_DB=####
LOCAL_PORT=###