Skip to content

Instantly share code, notes, and snippets.

Lucas Pires flyingluscas

Block or report user

Report or block flyingluscas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@flyingluscas
flyingluscas / ShellFunctions.md
Last active Nov 20, 2019
Shell functions to run things like NPM, Composer and PHP using Docker.
View ShellFunctions.md

Shell functions to run things using Docker.

Versions

Control the versions using environment variables, put this in your .bashrc or .zshrc.

PHP_VERSION=7.1
NODE_VERSION=8.0
@flyingluscas
flyingluscas / UsingFakerInPT-BR.md
Last active Nov 12, 2019
Utilizando Faker em pt-BR
View UsingFakerInPT-BR.md

Utilizando Faker em pt-BR

Acesse o seu arquivo app/Providers/AppServiceProvider.php, e no método register adicione o seguinte :

/**
 * Register any application services.
 *
 * @return void
 */
@flyingluscas
flyingluscas / FormsMySQLiPHP.md
Last active Nov 9, 2019
Formulários e MySQLi no PHP
View FormsMySQLiPHP.md

MySQLi Exemplos

1. Conexão

Vamos criar um arquivo chamado connection.php, neste arquivo vamos abrir uma conexão com nosso banco de dados.

Dessa forma, quando precisarmos de uma conexão com o banco de dados para executar uma query, só precisamos incluir o arquivo connection.php.

$link = mysqli_connect('localhost', 'username', 'password', 'database_name') or die(mysqli_connect_error());
@flyingluscas
flyingluscas / InstallPopcornTime.md
Last active Jul 25, 2019
Installing Popcorn Time on Ubuntu 16.x
View InstallPopcornTime.md

1. Downloading

32 bits version

$ wget https://get.popcorntime.sh/build/Popcorn-Time-0.3.10-Linux-32.tar.xz -O popcorntime.tar.xz

64 bits version

View InstallPHP7.0CLI.md
$ sudo add-apt-repository ppa:ondrej/php; sudo apt-get update
$ sudo apt-get install php7.1-cli -y
$ sudo apt-get install -y \
@flyingluscas
flyingluscas / MyUbuntuThemeConfigurations.md
Last active Feb 26, 2019
My Ubuntu Theme Configurations
View MyUbuntuThemeConfigurations.md

My Ubuntu Theme Settings

Install Theme

$ sudo add-apt-repository ppa:noobslab/themes
$ sudo apt-get update
$ sudo apt-get install flatabulous-theme

Install Icons Pack

View radix-sort.js
const unsortedArray = [123, 49, 7, 333]
const radix = (arr) => {
const max = Math.max(...arr).toString().length
const buckets = new Array(10)
let arrayWithLeftPaddedZeros = []
for (let i = 0; i < arr.length; i++) {
arrayWithLeftPaddedZeros[i] = arr[i].toString().padStart(max, '0')
}
@flyingluscas
flyingluscas / docker-compose.yml
Created May 14, 2017
CS 1.6 Server with Docker
View docker-compose.yml
version: '2'
services:
cstrike:
image: jarlefosen/cs16
container_name: cs16_server
ports:
- 26900:26900/udp
- 27020:27020/udp
- 27015:27015/udp
View goCircleCIGo.js
setInterval(() => {
if (document.querySelector('.css-1jwka9i').innerText === 'FAILED' || document.querySelector('.css-1jwka9i').innerText === 'CANCELED') {
document.querySelector('.css-1kqc31n').click()
document.querySelector('#menu-1 button:first-child').click()
console.log('Job reloaded!')
}
}, 60000)
View goTravisGo.js
setInterval(() => document.querySelectorAll('.jobs-list li.failed .action-button--restart').forEach(button => button.click()), 60000)
You can’t perform that action at this time.