Skip to content

Instantly share code, notes, and snippets.

View bashilbers's full-sized avatar
🎯
Focusing

Sebastiaan Hilbers bashilbers

🎯
Focusing
  • Basebuilder
  • 's-Hertogenbosch, The Netherlands
View GitHub Profile
#!/bin/sh
echo -e "\e[31m"
echo "recursively removing the following .svn folders from"
pwd
echo -e "\e[39m"
find . -type d -name .svn
@bashilbers
bashilbers / gist:9d650facb7ac07d95aad
Last active December 15, 2017 06:23
Web application performance tuning

Clientside profiling (ABSOLUTE MUST)

You can either:

  • Do it yourself:
    • Hook into the Navigation and Resource timing API
    • Emit requests to a static nginx webserver
    • The nginx server should return a 200 empty response
    • Parse the access_log with logstash
    • Monitor the performance with graphite
  • Or, use a SaaS ($$$), e.g.
  • Soasta
@bashilbers
bashilbers / gist:cd9b9a6bfeec0e21b11d
Last active August 29, 2015 14:21
php.ini tuning

ini files

  • The CLI sapi is using a different ini file. Make sure you optimize both the web and CLI one.
  • Scan your php.ini for best security practices with PHP iniscan tool.

memory

Save system resources by adjusting the memory_limit value. Don't know what an appropriate value would be? Ask yourself these questions:

  • what is the total amount of memory that you can allocate for PHP?
  • 512mb should a reasonable amount for a 2gb machine)
// Marionette.Gauntlet v0.0.0
// --------------------------
//
// Build wizard-style workflows with an event-emitting state machine
// Requires Backbone.Picky (http://github.com/derickbailey/backbone.picky)
//
// Copyright (C) 2012 Muted Solutions, LLC.
// Distributed under MIT license
// Modifications by Sebastiaan Hilbers
//
@bashilbers
bashilbers / app.js
Created January 29, 2014 10:14
M101JS 3.1
var mongo = require('mongoskin');
var _ = require('underscore')._;
var db = mongo.db('mongodb://localhost:27017/school');
var collection = db.collection('students');
var cursor = collection.find();
cursor.each(function(err, doc) {
if (!doc) return;
@bashilbers
bashilbers / EventDispatcher.php
Created December 5, 2012 07:51
RHM code example
<?php
/*
* The EventDispatcher is the central point of the event listener system, all classes which wish to send events must inherit from Event_Dispatcher.
*/
class Mercurius_Event_Dispatcher
implements Mercurius_Event_Dispatcher_Interface
{
/*
* Objects (handlers) listening for various events