Skip to content

Instantly share code, notes, and snippets.

View yurimorales's full-sized avatar

Yuri Morales yurimorales

  • Palhoça, SC - Brazil
View GitHub Profile
@yurimorales
yurimorales / iin_card
Created April 7, 2021 15:56 — forked from gusribeiro/iin_card
Regex para identificar bandeiras do cartão de crédito
Amex: /^3[47][0-9]{13}/
Aura: '^507860'
Banese Card: '^636117'
Cabal: '(60420[1-9]|6042[1-9][0-9]|6043[0-9]{2}|604400)'
Diners: '(36[0-8][0-9]{3}|369[0-8][0-9]{2}|3699[0-8][0-9]|36999[0-9])
Discover: /^6(?:011|5[0-9]{2})[0-9]{12}/
Elo: ^4011(78|79)|^43(1274|8935)|^45(1416|7393|763(1|2))|^504175|^627780|^63(6297|6368|6369)|(65003[5-9]|65004[0-9]|65005[01])|(65040[5-9]|6504[1-3][0-9])|(65048[5-9]|65049[0-9]|6505[0-2][0-9]|65053[0-8])|(65054[1-9]|6505[5-8][0-9]|65059[0-8])|(65070[0-9]|65071[0-8])|(65072[0-7])|(65090[1-9]|6509[1-6][0-9]|65097[0-8])|(65165[2-9]|6516[67][0-9])|(65500[0-9]|65501[0-9])|(65502[1-9]|6550[34][0-9]|65505[0-8])|^(506699|5067[0-6][0-9]|50677[0-8])|^(509[0-8][0-9]{2}|5099[0-8][0-9]|50999[0-9])|^65003[1-3]|^(65003[5-9]|65004\d|65005[0-1])|^(65040[5-9]|6504[1-3]\d)|^(65048[5-9]|65049\d|6505[0-2]\d|65053[0-8])|^(65054[1-9]|6505[5-8]\d|65059[0-8])|^(65070\d|65071[0-8])|^65072[0-7]|^(65090[1-9]|65091\d|650920)|^(65165[2-9]|6516[6-7]\d)|^(65500\d|65501\d)|^(65502[1-9]|6550[3-4]\d|65505[0-8])
Fort
@yurimorales
yurimorales / git.md
Last active January 15, 2021 17:02 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@yurimorales
yurimorales / SessionIdleHandler.php
Created February 28, 2019 17:44 — forked from bbene/SessionIdleHandler.php
Symfony 3 Auto Logout
<?php
// AppBundle/Handler/SessionIdleHandler.php
namespace AppBundle\Handler;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
@yurimorales
yurimorales / vimtutor.md
Created August 16, 2018 14:17 — forked from ericdouglas/vimtutor.md
Síntese de comandos das lições 4, 5, 6 e 7 do vimtutor

Localização e Status do Arquivo

  • ctrl g informa a sua localização no arquivo.
  • G leva o cursor para última linha do arquivo.
  • gg leva o cursor para primeira linha do arquivo.
  • 13 G leva o cursor para linha 13. ps: Digitando qualquer número no lugar do 13, te leva para a linha digitada.

Buscando por Palavras

  • /padrão vai buscar por uma incidência da palavra padrão no texto. Troque padrão por qualquer outra palavra que você queira encontrar.
@yurimorales
yurimorales / Install Gulp.txt
Created June 17, 2018 00:22 — forked from objarni/Install Gulp.txt
Installing gulp in Windows
1. Install nodejs. https://nodejs.org/en/
2. Check npm (node package manager) is installed via command prompt:
$ npm
3. Install gulp:
$ npm install gulp --global
4. In relevant project folder, create 'gulpfile.js':
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@yurimorales
yurimorales / .bashrc
Created January 3, 2018 19:45 — forked from marioBonales/.bashrc
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@yurimorales
yurimorales / read-long-file.php
Last active March 18, 2024 15:38 — forked from fj/gist:1597544
Slightly nicer way of writing large files to disk with PHP
<?php
// Copy big file from somewhere else
$src_filepath = 'http://example.com/all_the_things.txt'; //$src = fopen($src_filepath, 'r');
$tmp_filepath = '...'; // $tmp = fopen($tmp_filepath, 'w');
$buffer_size = 1024;
while (!feof($src)) {
$buffer = fread($src, $buffer_size); // Read big file/data source/etc. in small chunks
fwrite($tmp, $buffer); // Write in small chunks
}
@yurimorales
yurimorales / golang-nuts.go
Created October 17, 2017 13:30 — forked from ryanfitz/golang-nuts.go
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl