Skip to content

Instantly share code, notes, and snippets.

View wilcorrea's full-sized avatar
🚀
// TODO: be life good

William Correa wilcorrea

🚀
// TODO: be life good
View GitHub Profile
@wilcorrea
wilcorrea / Router.php
Last active October 22, 2016 19:33
Router.php
<?php
namespace Fagoc\Core;
class Router
{
private $method = 'GET';
private $uri = '';
/**
@wilcorrea
wilcorrea / $_GET.js
Last active November 4, 2016 19:16
<script>
function $_GET(name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
const regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)");
const results = regex.exec(url);
if (!results) {
return null;
@wilcorrea
wilcorrea / nginx-gitweb.md
Created November 9, 2016 12:07 — forked from mcxiaoke/nginx-gitweb.md
Set up Gitweb + Nginx from scratch on Debian Wheezy

This guide offers the least time-consuming way of setting up Nginx for serving Git repositories over HTTP using Gitweb. The stuff here has been tested with Git 1.9.1 and Nginx 1.6.0 on Debian Wheezy. Probably also works for Ubuntu, etc.

Total time ~ 10 minutes.

Install

Enable wheezy-backports by adding this line to /etc/apt/sources.list:

deb http://http.debian.net/debian wheezy-backports main
@wilcorrea
wilcorrea / git-hosting-apache.conf
Created November 9, 2016 19:26 — forked from karmi/git-hosting-apache.conf
Configuration for hosting Git repositories with Apache 2.x
# ----------------------------------------------------------
# Configuration for hosting Git repositories with Apache 2.x
# ----------------------------------------------------------
#
# This setup provides "dual URLS", where URL like <http://git.example.com/my_repository.git>
# loads Gitweb in the browser and the same URL can be used in commands like `git clone` and `git remote add`.
# It was compiled from some sources on the internet and further customized/tuned.
#
# Please see documentation for:
#
<?php
include 'conexao.php';
$noticias = $DB->query("SELECT * FROM noticias WHERE categoria = '{$_GET['categoria']}'");
while ($noticia = $DB->fetch($noticias)) {
?>
<div>
<?php
<?php
namespace HeroProject;
class Connection
{
// put the database stuffs here in that scope
}
@wilcorrea
wilcorrea / db.sql
Last active November 10, 2016 16:18
CREATE TABLE `clientes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nome` varchar(500) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@wilcorrea
wilcorrea / post.md
Created November 22, 2016 13:25 — forked from vinicius73/post.md
["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]

#["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]

Se preparem que o texto é longo.

Várias vezes chegam novatos aqui perguntando como começar, e a galera diz "estuda lógica primeiro, depois vai pra linguagem X". Vivo dizendo que é bobagem. Ontem, em particular, falei isso, e vieram várias pessoas por inbox me perguntar porquê (e uma pra me xingar, achando que falei por arrogância).

Pra facilitar, eu vou escrever uma boa explicação de porquê "lógica de programação" é furada, doa a quem doer, e postar na APDA e no fórum da EnergyLabs (para futuras referências, porque esse assunto vai voltar, ctz).

{
"name": "company/project",
"description": "PHP Hero Project",
"minimum-stability": "dev",
"license": "proprietary",
"authors": [
{
"name": "Me",
"email": "myemal@mycompany.com"
}
{
"name": "company/project",
"description": "PHP Hero Project",
"minimum-stability": "dev",
"license": "proprietary",
"authors": [
{
"name": "Me",
"email": "myemal@mycompany.com"
}