Skip to content

Instantly share code, notes, and snippets.

View dzuelke's full-sized avatar

David Zülke dzuelke

View GitHub Profile
<?php
$re = '{^(\\s*\\{\\s*(?:"(?:[^\\0-\\x09\\x0a-\\x1f\\\\"]+|\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4})*"\\s*:\\s*(?:[0-9.]+|null|true|false|"(?:[^\\0-\\x09\\x0a-\\x1f\\\\"]+|\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4})*"|\\[(?:[^\\]]*|\\[(?:[^\\]]*|\\[(?:[^\\]]*|\\[(?:[^\\]]*|\\[[^\\]]*\\])*\\])*\\])*\\]|(?:[^{}]*|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{[^{}]*\\})*\\})*\\})*\\})*)*\\]|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{[^{}]*\\})*\\})*\\})*\\})*\\})\\s*,\\s*)*?)("require"\\s*:\\s*)((?:[0-9.]+|null|true|false|"(?:[^\\0-\\x09\\x0a-\\x1f\\\\"]+|\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4})*"|\\[(?:[^\\]]*|\\[(?:[^\\]]*|\\[(?:[^\\]]*|\\[(?:[^\\]]*|\\[[^\\]]*\\])*\\])*\\])*\\]|(?:[^{}]*|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{[^{}]*\\})*\\})*\\})*\\})*)*\\]|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{(?:[^{}]*|\\{[^{}]*\\})*\\})*\\})*\\})*\\}))(.*)}s';
$str = '{
"config": {
"cache-files-ttl": 0,
"discard-changes": true
},
"minimum-stability": "stable",
[10-Mar-2016 18:49:34 UTC] [2016-03-10 18:49:34] production.ERROR: exception 'BadMethodCallException' with message 'Method after does not exist.' in bootstrap/cache/compiled.php:6254
Stack trace:
#0 bootstrap/cache/compiled.php(2193): Illuminate\Routing\Router->__call('after', Array)
#1 bootstrap/cache/compiled.php(2193): Illuminate\Routing\Router->after(Object(newrelic\Laravel\AfterFilter))
#2 bootstrap/cache/compiled.php(2193): Illuminate\Foundation\Application->boot()
#3 bootstrap/cache/compiled.php(1641): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#4 bootstrap/cache/compiled.php(2374): Illuminate\Foundation\Application->bootstrapWith(Array)
#5 bootstrap/cache/compiled.php(2327): Illuminate\Foundation\Http\Kernel->bootstrap()
#6 bootstrap/cache/compiled.php(2312): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#7 public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Reques
@dzuelke
dzuelke / erp.txt
Created February 25, 2016 17:37
COMPOSER Y U NO REPLACE OR PROVIDE PLATFORM PACKAGES
dzuelke-ltm1:wat dzuelke$ PHP_INI_SCAN_DIR= php -c /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini $(which composer) require alcaeus/mongo-php-adapter:dev-master
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing mongodb/mongodb (1.0.0)
Loading from cache
- Installing alcaeus/mongo-php-adapter (dev-master 4adcbe7)
Cloning 4adcbe7a75f3c684bc1651ccdb7addefc089066c
@dzuelke
dzuelke / composer01.json
Created February 23, 2016 17:34
Composer replace ext test cases
{
"repositories": [
{
"packagist": false
},
{
"type": "package",
"package": [
{
"type": "metapackage",
@dzuelke
dzuelke / libpq_openssl.php
Created February 12, 2016 23:50
libpq+openssl conflict reproduce case
<p>
<?php
$db = parse_url(getenv("DATABASE_URL"));
$sql = "SELECT repeat('a', 160000)";
$c = pg_connect(sprintf("host='%s' port='%s' dbname='%s' user='%s' password='%s' sslmode='require'", $db["host"], $db["port"], substr($db["path"], 1), $db["user"], $db["pass"]));
$r = openssl_pkey_get_public('a');
@dzuelke
dzuelke / cmfdeploy.sh
Last active February 1, 2016 09:39
Deploying Symfony CMF to Heroku
git clone https://github.com/symfony-cmf/cmf-sandbox.git
cd cmf-sandbox
composer install
# declare optional extensions as required
php -dmemory_limit=4G $(which composer) require "ext-gd:*" "ext-exif:*"
git add composer.json composer.lock
git commit -m "require gd and exif extensions"
# add DATABASE_URL mapping to composer.json and update DB config (see database.diff)
php -dmemory_limit=4G $(which composer) update --lock
git add composer.json composer.lock app/config/config.yml app/config/config_prod.yml
$ composer install --no-interaction
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
> ExpressiveInstaller\OptionalPackages::install
Setup data and cache dir
Setting up optional packages
- Adding package zendframework/zend-expressive-fastroute (^1.0)
- Copying /config/autoload/routes.global.php
- Adding package zendframework/zend-servicemanager (^2.7.3 || ^3.0)
- Adding package ocramius/proxy-manager (^1.0)
- Copying /config/container.php
@dzuelke
dzuelke / F1.terminal
Created March 18, 2012 16:15
OS X Terminal.app settings (1680x1050 fullscreen mode) for live-f1 (brew tap adamv/alt && brew install live-f1 or do it manually from https://launchpad.net/live-f1)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.0</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OViRjbGFzc1xOU0NvbG9yU3BhY2VXTlNXaGl0ZYAC
@dzuelke
dzuelke / agavi-esi.patch
Created June 30, 2011 11:41
Simple prototype of Edge Site Includes support for slots in Agavi
Index: samples/app/modules/Default/actions/Widgets/MenuAction.class.php
===================================================================
--- samples/app/modules/Default/actions/Widgets/MenuAction.class.php (revision 4758)
+++ samples/app/modules/Default/actions/Widgets/MenuAction.class.php (working copy)
@@ -71,6 +71,11 @@
return 'Success';
}
+ public function generateEsiUrl(AgaviRouting $ro, AgaviRequestDataHolder $rd = null)
+ {
@dzuelke
dzuelke / redact.rb
Created December 17, 2014 21:58
Pipe 'heroku config' output through this script to redact credentials
#!/usr/bin/env ruby
require 'uri'
ARGF.each_line do |line|
key, value = line.split(':', 2)
if !value
$stdout.puts key
next