Skip to content

Instantly share code, notes, and snippets.

View viniciusvts's full-sized avatar

Vinicius de Santana viniciusvts

  • Secretaria de Educação do Estado da Bahia
  • Salvador, Bahia, Brazil
  • LinkedIn in/viniciusvts
View GitHub Profile
@viniciusvts
viniciusvts / createComposerPackage.md
Last active January 12, 2025 15:35
Step by step to develop and publish a composer package

Step-by-step composer package

Developing the package

  • Create a composer.json file
{
  "name": "your-user/package-name",
  "description": "Package Description",
  "type": "library",
  "require": {
    "php": ">=7.4"

Config deploy

In gitlab:

If your repository is not public generate a new deploy token:

  • Go to Settings >> Repository >> Deploy Tokens
  • Generate a new Deploy Token. You get an username and a deploy_token

In Jenkins

Jenkins version tested: (ver. 2.235.2)

  • Go to settings of a project
/**
* Automatiza a criação e inserção do codiguin do free fire
* Objetivo: gerar codiguins automaticamente e tentar validar no site da garena
* Para executar:
* - primeiro entre e faça login em https://reward.ff.garena.com/en
* - na aba do Rewards Redemption Site, cole no terminal a function "tentaCodiguin" acima, isso habilitará o uso da função
* - execute no terminal um setInterval chamando a function, isso gerará codiguins e executará no servidor da garena:
* > codiguinIterval = setInterval(()=>{ tentaCodiguin("W8TAU", 12,1) }, 5000);
* - e para parar:
* > clearInterval(codiguinIterval);

Add submodule to project

It add the submodule:

git submodule add -b <branch> <repository_url> <diretory_path>

Clone projects with submodules:

Cloning a project who has submodules, use the clone command with the option --recurse-submodules. It will garantee submodules are also cloned.

git clone --recurse-submodules <repository_url>

Create a file with the authors

Enter in your local svn repo and execute the following command, this creates a users.txt file

svn log -q | awk -F '|' '/^r/ {gsub(/ /, "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > users.txt

An filled line example:

admin.svn = Admin Svn <[email protected]>

Init a git repository

@viniciusvts
viniciusvts / laravel-8-project-creation.md
Last active May 27, 2022 19:20
Laravel 8 my project instalation

Install laravel

composer create-project laravel/laravel:^8.0 example-app-name
cd example-app-name

Start git flow

git flow init
git remote add origin http://repository.url.git
git push -u origin master
git push -u origin develop
// Web Masks
/**
* Mascara de Telefone para ser usada em inputs html
* @param {KeyboardEvent} evt - O evento será entregue aqui
* @example <caption>Executa a mascara quando evento keyup é lançado.</caption>
* document.querySelector('#phone').addEventListener('keyup',execMascaraTel);
* @author Vinicius de Santana <[email protected]>
* @license CC BY-NC
*/
@viniciusvts
viniciusvts / install-apache.md
Last active September 18, 2023 12:53
how-to

instalar o apache web server

pelo gerenciador de pacotes

pacman -S apache

configurações:

  1. editar o arquivo /etc/httpd/conf/httpd.conf
@viniciusvts
viniciusvts / intall-mariadb.md
Last active September 18, 2023 12:54
how-to

Instalar mariadb

primeiro instala pelo gerenciador de pacotes

#pacman -S mariadb

instala os dados no caminho padrão: /var/lib/mysql

sudo mysql_install_db --user=mysql --ldata=/var/lib/mysql

inicia o servidor do banco

sudo systemctl start mariadb