Skip to content

Instantly share code, notes, and snippets.

View OzzyCzech's full-sized avatar
👋
Hi there...

Roman Ožana OzzyCzech

👋
Hi there...
View GitHub Profile
@jaywilliams
jaywilliams / array_to_object.php
Created December 16, 2009 04:57
Convert a multi-dimensional array into a stdClass object. Pass by reference.
<?php
/**
* Convert a multi-dimensional array into a stdClass object.
*
* Example:
* $values = array('hello'=>'world');
*
* // Convert the array to an object
* array_to_object($values);
*
@addyosmani
addyosmani / scratchpad.md
Last active October 25, 2017 15:34
Webpack Performance Presets

"We need Webpack presets" and "Webpack and its plugins are too hard to configure correctly" have been the number one cause of developer pain shared with me from large sites adopting Progressive Web Apps and optimising their load performance.

If I was building a Webpack preset pack for performance, I might use the following:

  • Ensure you're using a production build of your framework: new webpack.DefinePlugin({ 'process.env': env })
  • Minify your JS: webpack.optimize.UglifyJsPlugin
  • Compress your resources (GZip): compression-webpack-plugin
  • Split your vendor chunks: CommonsChunkPlugin
@RadekDvorak
RadekDvorak / Lock.php
Created July 19, 2011 13:19
Hack na FileJournal v Nette
<?php
/**
* Exclusive lock in memcache
*
* @author Radek Dvořák <radek.dvorak@profimedia.cz>
*/
class Lock
{
/**