Skip to content

Instantly share code, notes, and snippets.

View pionl's full-sized avatar

Martin Kluska pionl

View GitHub Profile
@jasonvarga
jasonvarga / aliases.sh
Created January 8, 2019 17:30
Turn off xdebug while running phpunit
# First, copy ext-xdebug.ini to ext-xdebug.ini.bak
alias xdebug-disable='echo "" > /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini'
alias xdebug-restore='cat /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini.bak > /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini'
function phpunit {
xdebug-disable
./vendor/bin/phpunit "$@"
xdebug-restore
}
@thepsion5
thepsion5 / BaseController.php
Last active February 29, 2020 15:27
Example of using A Laravel Controller to automatically handle validation exceptions and auth failures
<?php
class BaseController extends Controller
{
public function callAction($method, $params)
{
$ajax = Request::isAjax();
try {
return parent::callAction($method, $params);
var textNormalizer = (function() {
function hasFontSize(dom) {
if (!dom) {
return false;
}
if (!dom.style) {
return false;
}
var fs = dom.style.fontSize;
@nambok
nambok / MY_Input.php
Created October 4, 2012 14:53
Extends codeigniter input class to accept put and delete requests
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Input extends CI_Input {
/**
* Variables
*
*/
protected $delete;