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
| xcode-select --install | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew update | |
| brew cask install iterm2 | |
| # update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts | |
| brew install bash # latest version of bash | |
| # set brew bash as default shell | |
| brew install fortune | |
| brew install cowsay | |
| brew install git |
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
| <?php | |
| function soma_horas() { | |
| $i = $s = $hour = $min = $sec = 0; | |
| foreach (func_get_args() as $time) { | |
| sscanf($time, '%d:%d:%d', $hour, $min, $sec); | |
| $i += ($hour * 60) + $min + ($sec / 60); | |
| $s += $sec; | |
| } |
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
| ## command 1- Instalar pacotes essenciais | |
| apt-get install curl graphicsmagick build-essential | |
| ## command 2- Adicionar packages mongodb | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
| ## command 3- Adicionar repository mongodb | |
| echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
| ## command 4- Atualizar ubuntu e instalar mongodb |
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
| #!/bin/bash | |
| # Vesta Ubuntu installer v.05 | |
| # Modified by David B (KernelPanic89) to work for Ubuntu | |
| # Revision 1.0 - Sep 06 2016 | |
| #----------------------------------------------------------# | |
| # Variables&Functions # | |
| #----------------------------------------------------------# | |
| @h@export PATH=$PATH:/sbin |
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
| <?php | |
| header("Content-type: application/json; charset=utf-8"); | |
| $http_origin = $_SERVER['HTTP_ORIGIN']; | |
| $allowed_http_origins = array( | |
| "http://site1.com.br", | |
| "http://site2.com.br", | |
| "http://site3.com.br" | |
| ); | |
| if (in_array($http_origin, $allowed_http_origins)){ |
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
| <?php | |
| function geraLetras($length) { | |
| global $abc; | |
| settype($abc, "string"); | |
| $abc = "abcdefghijklmnopqrstuvwxyz"; | |
| settype($length, "integer"); |
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
| <?php | |
| $preco=Convert('USD', 'BRL','1,00'); | |
| if($preco!=false){ | |
| echo $preco; | |
| } | |
| else{echo "conversão não possível";} | |
| function Convert($from, $to, $preco) | |
| { | |
| $url = "http://www.google.com/finance/converter?a=$preco&from=$from&to=$to"; |
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
| <?php | |
| function mask($val, $mask) | |
| { | |
| $maskared = ''; | |
| $k = 0; | |
| for($i = 0; $i<=strlen($mask)-1; $i++) | |
| { | |
| if($mask[$i] == '#') | |
| { | |
| if(isset($val[$k])) |
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
| <?php | |
| include("Validator.php"); | |
| $email = "asasasas@outlook.com"; | |
| if(Validator::EmailReal($email)){ | |
| echo "The email is valid"; | |
| }else{ | |
| echo "That’s an invalid 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
| --- | |
| ip: "192.168.10.10" | |
| memory: 2048 | |
| cpus: 1 | |
| authorize: C:\Users\JoaoPinheiro\.ssh\id_rsa.pub | |
| keys: | |
| - C:\Users\JoaoPinheiro\.ssh\id_rsa |