Skip to content

Instantly share code, notes, and snippets.

@claar
claar / _ide_helper_former.php
Created January 26, 2018 21:37
Former IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
namespace Former\Facades {
class Former {
/**
* Register a macro with Former
*
* @param string $name The name of the macro
* @param Callable $macro The macro itself
* @return mixed
@claar
claar / TestController.php
Last active May 30, 2017 20:06
Former field help block doesn't render inside blade @section
<?php
class MilkTrackersController extends App\Http\Controllers\Controller
{
public function getIndex()
{
return view('test1');
}
}
@claar
claar / laravel-compiled-php-benchmark
Created February 2, 2016 18:48
Quick benchmark of Laravel with and without compiled.php optimization - conclusion: no perceived benefit within my Vagrant environment.
## RUN 1 - no compiled.php, no xdebug
Concurrency Level: 1
Time taken for tests: 10.028 seconds
Complete requests: 500
Failed requests: 0
Non-2xx responses: 500
Total transferred: 674222 bytes
HTML transferred: 174000 bytes
Requests per second: 49.86 [#/sec] (mean)
@claar
claar / nginx.conf
Last active August 29, 2015 14:11
nginx config - FIPS complient, SSL stapling, POODLE mitigation, session caching
##
# Global SSL settings - nginx.conf in http section
##
##
# For additional performance, enable SPDY support for each site by changing the:
#
# listen 443 ssl;
#
# line to:
@claar
claar / Easy PHP CLI debugging
Created September 20, 2014 02:52
Easy PHP CLI debugging
##### /etc/php5/mods-available/xdebug-local.ini #####
xdebug.remote_autostart = on
##### /home/claar/bin/pdbg #####
#!/bin/bash
db=$1
usage () {
echo "Usage: `basename $0` on|off"
language: php
php:
- 5.5
before_script:
- mkdir -p build
- mkdir -p shippable/testresults
- mkdir -p shippable/codecoverage
- phpunit --version
@claar
claar / gist:1001327
Created May 31, 2011 21:32 — forked from anonymous/gist:1001317
claar-postgres-plan
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=2155935.40..2155935.52 rows=50 width=4) (actual time=8060.510..8060.547 rows=50 loops=1)
-> Sort (cost=2155935.40..2155935.80 rows=162 width=4) (actual time=8060.504..8060.523 rows=50 loops=1)
Sort Key: inv_asset_view.asset_id
Sort Method: top-N heapsort Memory: 18kB
-> Subquery Scan on inv_asset_view (cost=97.06..2155930.01 rows=162 width=4) (actual time=28.885..8057.971 rows=2703 loops=1)
-> Hash Left Join (cost=97.06..2155928.39 rows=162 width=2430) (actual time=28.884..8056.156 rows=2703 loops=1)
Hash Con