This gist was getting a lot of comments/questions, but since there are no notifications when someone replies to a gist, I've moved the setup instructions and a bunch of sample code to a dedicated Github repo.
This file contains hidden or 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
namespace App\Http\Middleware; | |
use Illuminate\Support\Facades\Log; | |
class LogAfterRequest { | |
public function handle($request, \Closure $next) | |
{ | |
return $next($request); | |
} |
This file contains hidden or 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 src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script> | |
<form method="POST" enctype="multipart/form-data" action="https://www.google.com/save" id="myForm"> | |
<input type="hidden" name="img_val" id="img_val" value="" /> | |
</form> | |
<div id="more"> | |
<h1 style='color: red'> hello </h1> | |
<iframe src="https://tags.mli.me/12751"> | |
</iframe> |
This file contains hidden or 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 | |
/** | |
* Plugin Name: Customize Post Preambles | |
* Author: Weston Ruter, XWP | |
* Description: Demo plugin for Customize Posts to add a section before each post in The Loop that contains a preamble content stored in postmeta. | |
* | |
* @package CustomizePostPreambles | |
*/ | |
namespace CustomizePostPreambles; |
This file contains hidden or 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
set guifont=Fira_Code:h15 " font for mac vim | |
set linespace=14 " line spacing for macvim | |
set macligatures " Fira code symbols enables | |
set guioptions-=e " Disable GUI tabs | |
" remove any scrollbar | |
set guioptions-=L | |
set guioptions-=l | |
set guioptions-=R | |
set guioptions-=r |
This file contains hidden or 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 | |
__ | |
_e | |
_ex | |
esc_attr__ | |
esc_attr_e | |
esc_attr_x | |
esc_html__ | |
esc_html_e | |
esc_html_x |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
This file contains hidden or 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 App\Http; | |
use Illuminate\Foundation\Http\Kernel as HttpKernel; | |
class Kernel extends HttpKernel | |
{ | |
protected $middleware = [ | |
\App\Http\Middleware\NewRelicPatch::class, | |
//... your other middlewares | |
]; |
This file contains hidden or 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 | |
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy | |
// code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup | |
// CREATE CUSTOM TAXONOMY | |
add_action( 'init', '___create_my_custom_tax' ); |
This file contains hidden or 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
$address = array( | |
'first_name' => $customer_name, | |
'last_name' => '', | |
'company' => '', | |
'email' => $customer_email, | |
'phone' => $customer_phone, | |
'address_1' => '', | |
'address_2' => '', | |
'city' => '', | |
'state' => '', |