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 / server-git.conf
Created December 1, 2016 12:55 — forked from massar/server-git.conf
Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# jeroen@massar.ch - http://jeroen.massar.ch
server {
listen 192.0.1.1:80;
listen [2001:db8::1]:80;
# Redirect all non-HTTPS traffic to the HTTPS variant
return 301 https://$host$request_uri;
}
<?php
namespace Hero;
class Router
{
private $routes = [];
public function on($method, $path, $callback) {
// make a hero return;
<?php
namespace Hero;
class Router
{
private $routes = [];
public function on($method, $path, $callback)
{
# sudo a2enmod modrewrite
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [NC,L]
<?php
define('__APP_ROOT__', dirname(__DIR__));
require __APP_ROOT__ . '/vendor/autoload.php';
use Hero\Router;
$router = new Router();
<?php
if (!function_exists('mysql_connect')) {
function mysql_connect((parameters)) {
return MySQL::connect((parameters)); // equivalente em mysqli
}
}
if (!function_exists('mysql_query')) {
function mysql_query($sql) {
@wilcorrea
wilcorrea / an-component.vue
Created December 2, 2016 13:32 — forked from vinicius73/an-component.vue
Helpers to filter collections
<script>
// an component
import { orderBy, isEmpty } from 'lodash';
import filterByName from '../helpers/filters/by-name';
// omit
computed: {
listOrdened() {
const { orderBy as by, order } = this.configs;
@wilcorrea
wilcorrea / gist:ab9fdee5c6dba69cb4b20ca63d58508a
Created December 6, 2016 06:12 — forked from jason-engage/gist:56b3df8f294af35cd58d
Gulp File for Minifying / Concat / Removing Comments and Console logs of Ionic Project
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var compass = require('gulp-compass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var sh = require('shelljs');
var path = require('path');
<?php
namespace Core\Mail;
/**
* Class Imap
* @package Core\Mail
*/
class Imap
{
<?php
class Fillable
{
/**
* @var array
*/
protected $fields = [];
/**
* @var array