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
# 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; | |
} |
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 | |
namespace Hero; | |
class Router | |
{ | |
private $routes = []; | |
public function on($method, $path, $callback) { | |
// make a hero return; |
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 | |
namespace Hero; | |
class Router | |
{ | |
private $routes = []; | |
public function on($method, $path, $callback) | |
{ |
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
# sudo a2enmod modrewrite | |
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php [NC,L] |
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 | |
define('__APP_ROOT__', dirname(__DIR__)); | |
require __APP_ROOT__ . '/vendor/autoload.php'; | |
use Hero\Router; | |
$router = new Router(); |
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 | |
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) { |
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> | |
// an component | |
import { orderBy, isEmpty } from 'lodash'; | |
import filterByName from '../helpers/filters/by-name'; | |
// omit | |
computed: { | |
listOrdened() { | |
const { orderBy as by, order } = this.configs; |
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
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'); |
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 | |
namespace Core\Mail; | |
/** | |
* Class Imap | |
* @package Core\Mail | |
*/ | |
class Imap | |
{ |
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 | |
class Fillable | |
{ | |
/** | |
* @var array | |
*/ | |
protected $fields = []; | |
/** | |
* @var array |