Skip to content

Instantly share code, notes, and snippets.

View basz's full-sized avatar

Bas Kamer basz

View GitHub Profile
<?php
include 'vendor/autoload.php';
if (!isset($_GET['in'])) {
echo "USAGE: php demo.php <pdf_file> [<output_pdf_file>]\n";
exit;
}
try {
<?php
namespace BsbDoctrineTranslator\PhpParser\Lexer;
use PhpParser;
class FileOffsetLexer extends PhpParser\Lexer
{
/**
class AnyModule
{
public function onBootstrap(Event $e)
{
$application = $e->getApplication();
$services = $application->getServiceManager();
$config = $services->get('config');
print_r($config['slm_queue']);
// why $serviceLocator->getServiceLocator() in the canCreateServiceWithName method different from createServiceWithName? How would I get to the global SM?
class FilesystemAbstractFactory implements AbstractFactoryInterface
{
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
var_dump(get_class($serviceLocator));
// string(38) "BsbFlysystem\Service\FilesystemManager"
@basz
basz / $this->strategyConfig
Created October 23, 2014 09:19
WorkerFactory.php
// before and after configuration normalization and merging
Array
(
[default] => Array
(
[0] => SlmQueue\Strategy\AttachQueueListenersStrategy
[SlmQueue\Strategy\MaxRunsStrategy] => Array
(
[max_runs] => 32
<?php
/**
* Sandalinos by Podolab Hoeksche Waard
*
* @link https://plhw.nl/
* @copyright Copyright (c) 2010 - 2014 Bushbaby Multimedia. (http://bushbaby.nl)
* @license Proprietary License
*/
rattletrap-2:sandalinos.nl bas$ php public/index.php
PHP Warning: array_map(): An error occurred while invoking the map callback in /Users/bas/Documents/Projects/PLHW.Sandalinos.Website/sandalinos.nl/vendor/doctrine/doctrine-orm-module/src/DoctrineORMModule/Module.php on line 138
PHP Stack trace:
PHP 1. {main}() /Users/bas/Documents/Projects/PLHW.Sandalinos.Website/sandalinos.nl/public/index.php:0
PHP 2. Zend\Mvc\Application::init() /Users/bas/Documents/Projects/PLHW.Sandalinos.Website/sandalinos.nl/public/index.php:18
PHP 3. Zend\Mvc\Application->bootstrap() /Users/bas/Documents/Projects/PLHW.Sandalinos.Website/sandalinos.nl/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:254
PHP 4. Zend\ServiceManager\ServiceManager->get() /Users/bas/Documents/Projects/PLHW.Sandalinos.Website/sandalinos.nl/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:153
PHP 5. Zend\ServiceManager\ServiceManager->create() /Users/bas/Documents/Projects/PLHW.Sandalinos.Website/sandalinos.n
rattletrap:dist bas$ cat /private/var/folders/m_/ct1k7m197m181znf11ks43740000gp/T/output1410769513609
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
objc[10610]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Launching GlassFish on Felix platform
sep 15, 2014 10:25:16 AM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner createBundleProvisioner
INFO: Create bundle provisioner class = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.
sep 15, 2014 10:25:16 AM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations
WARNING: Skipping entry because it is not an absolute URI.
sep 15, 2014 10:25:16 AM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer
four siege tests... two for a .txt file and two for a .js file. each one is done on port 80 (varnish) and two directly to apache (port 81)
Now look at the file sizes of the 3rd test. It's randomly incorrect...
Must be varnish related, but I am stumped on why. I have noticed this on other js files before but am unable to find anything on this with google.
At the bottom I do some more tests with and without compression for the js file.
rattletrap:~ bas$ siege -t5s http://bushbaby.nl:80/lorum.txt && \
siege -t5s http://bushbaby.nl:81/lorum.txt && \
@basz
basz / maparea
Created September 5, 2014 12:53
import Ember from 'ember';
import ContainerListCollectionView from 'my-new-app/views/map/container-list-collection';
export default Ember.ContainerView.extend({
classNames: [],
childViews: ['mapView', 'listView'],
mapView: Ember.View.create({
templateName: 'map/stage'
}),
listView: Ember.View.create({