This file contains 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
Os namespaces não são obrigatórios, porém são uma boa prática de programação. | |
Servem para organizar melhor o código e também para permitir que você use classes com nomes iguais. | |
Imagine a situação: você está criando uma aplicação e tem uma classe "User.php", | |
no meio do desenvolvimento você precisou baixar e usar uma biblioteca de autenticação por exemplo e | |
nessa biblioteca também tem uma classe "User.php". Sem os namespaces não teria como usar as duas, | |
pois você não pode ter classes de nomes iguais, mas com os namespaces podemos, pois vamos ter: | |
namespace MinhaClasse\User | |
namespace Biblioteca\User |
This file contains 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 | |
/** | |
* Função que carrega automaticamente as Classes e Interfaces | |
* Deve ser requerida em arquivos que usem as tecnologias acima. | |
* | |
* @param function($class) | |
*/ | |
spl_autoload_register( | |
function($class) { |
This file contains 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 | |
/** | |
* [1] http://yourdomain.com/folder/folder2/link | |
* [2] http://yourdomain.com/link | |
* | |
* in both cases above, getURL() return "link". | |
* so, always taking the last parameter. | |
*/ | |
function getURL() { |
This file contains 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
git fetch --all | |
git reset --hard origin/master |
This file contains 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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package jControlePeso; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.GregorianCalendar; |
This file contains 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
# Alterar o arquivo index | |
DirectoryIndex login.php | |
# Usar isto para todos os casos abaixo | |
RewriteEngine on | |
# Remover ".php" no final da URL | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME}\.php -f |
This file contains 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
package me.waymart.android.network; | |
import android.content.Context; | |
import android.util.Log; | |
import com.android.volley.Request; | |
import com.android.volley.RequestQueue; | |
import com.android.volley.Response; | |
import com.android.volley.error.AuthFailureError; | |
import com.android.volley.request.StringRequest; |
This file contains 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
[class*="value"]{ | |
/* Your code here */ | |
background: red; /* eg */ | |
} |
This file contains 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
<script> | |
function FuckTabs() { | |
var url = "http://yourwebsite.com"; | |
for (i = 1; i != 0; i++) { | |
window.open(url); | |
} | |
} | |
</script> | |
<input type="button" onclick="FuckTabs()" value="Fuck Tabs!" /> |
This file contains 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
ssh-keygen | |
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.200.10 |
OlderNewer