Skip to content

Instantly share code, notes, and snippets.

View Tmeister's full-sized avatar
🇲🇽
Working from home

Enrique Chavez Tmeister

🇲🇽
Working from home
View GitHub Profile
<?php
namespace App\Http\Middleware;
use Closure;
class CountryMiddleware
{
/**
* Handle an incoming request.
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
<?php
/**
* The application's global HTTP middleware stack.
*
* @var array
*/
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
<?php
/**
* The application's route middleware.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
( function() {
var app = angular.module( 'jwtAuth', [] );
app.controller( 'MainController', function( $scope, $http ) {
var apiHost = 'http://yourdomain.com/wp-json';
$http.post( apiHost + '/jwt-auth/v1/token', {
username: 'admin',
password: 'password'
@Tmeister
Tmeister / gulpfile.js
Last active October 12, 2017 15:58
Simple Gulpfile to use with underscores "_s" theme
'use strict';
var gulp = require( 'gulp' );
var browserSync = require( 'browser-sync' ).create();
var sass = require( 'gulp-ruby-sass' );
var del = require( 'del' );
gulp.task( 'sass', function() {
return sass( 'sass/style.scss' )
.on( 'error', sass.logError )
@Tmeister
Tmeister / gist:49fb31f57c5358569680
Created December 9, 2015 00:05
ApacheBench With PHP 5.5.9 / WordPress 4.3.1
root@wp-back-in-black:~# ab -t30 -c5 http://prezipremiumtemplates.com/
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking prezipremiumtemplates.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
@Tmeister
Tmeister / gist:04ecd80d14d03ba4a249
Created December 9, 2015 00:07
ApacheBench With PHP 7.0 / WordPress 4.3.1
root@wp-back-in-black:~# ab -t30 -c5 http://prezipremiumtemplates.com/
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking prezipremiumtemplates.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
SELECT `post_title`,
SUBSTRING_INDEX(`post_title`, ' ', 1) AS `name`,
SUBSTRING_INDEX(`post_title`, ' ', -1) AS `last_name`
FROM `wp_posts`
ORDER BY `last_name` ASC;
//see: http://cl.ly/0W121f3B1z0a
{
"properties": {
"lang": "es",
"country": "mx",
"currency": "MX$"
},
"seed": {
"keyword": "Car",
"competition": "0.12",
"bid": "12.93",