This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var timeSeconds = 0; | |
var timestampDivList = document.querySelectorAll(".timestamp"); | |
for(var i = 0; i < timestampDivList.length; i++) { | |
var timestampDiv = timestampDivList[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name CHANGEME.app; /*Alterar para nome do projeto */ | |
root /var/www/vhosts/CHANGEME.app/public; /*Alterar para caminho do projeto */ | |
index index.html index.htm index.php; | |
charset utf-8; | |
location / { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function titleCase($string, $delimiters = array(" ", "-", ".", "'", "O'", "Mc"), $exceptions = array("de", "da", "dos", "das", "do", "I", "II", "III", "IV", "V", "VI")) | |
{ | |
/* | |
* As exceções em minúsculas são palavras que você não deseja converter | |
* Exceções em maiúsculas são quaisquer palavras que você não quer converter para o caso do título | |
* Mas deve ser convertido em maiúscula, por exemplo: | |
* rei henry viii ou rei henry Viii deveria ser o rei Henrique VIII | |
*/ | |
if (filter_var($string, FILTER_VALIDATE_EMAIL)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function validaCPF($cpf) | |
{ | |
// determina um valor inicial para o digito $d1 e $d2 | |
// pra manter o respeito ;) | |
$d1 = 0; | |
$d2 = 0; | |
// remove tudo que não seja número | |
$cpf = preg_replace("/[^0-9]/", "", $cpf); | |
// lista de cpf inválidos que serão ignorados | |
$ignore_list = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function validaCNPJ($cnpj) | |
{ | |
// Lista de CNPJs inválidos | |
$invalidos = [ | |
'00000000000000', | |
'11111111111111', | |
'22222222222222', | |
'33333333333333', | |
'44444444444444', | |
'55555555555555', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sortNumber = function(x, y) | |
{ | |
return x - y; | |
}; | |
var nums = [-23,61,18,30,8,-46,69,67,43,617]; | |
nums.sort(sortNumber); | |
console.log(nums); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nums = [-23,61,18,30,8,-46,69,67,43,617]; | |
for(i = 0; i < nums.length; i++) | |
{ | |
if(nums[i] < nums[i+1]) | |
{ | |
aux = nums[i]; | |
nums[i] = nums[i+1]; | |
nums[i+1] = aux; | |
i = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
# If not running interactively, don't do anything |
OlderNewer