Skip to content

Instantly share code, notes, and snippets.

@sylvainfilteau
sylvainfilteau / app-model-Bug.js
Created August 21, 2012 15:01
Warning when loading stores with Ext.application
Ext.define('App.model.Bug', {
extend: 'Ext.data.Model',
fields: ['id', 'title', 'description']
});
@sylvainfilteau
sylvainfilteau / php.rb
Created May 6, 2012 17:34
Homebrew formula for PHP 5.4.0
require 'formula'
def mysql_installed?
`which mysql_config`.length > 0
end
def postgres_installed?
`which pg_config`.length > 0
end
@sylvainfilteau
sylvainfilteau / mapreduce.php
Created March 9, 2012 22:09
PHP map reduce (I hate myself)
<?php
$partition = function ($mapper, array $data, $nb_batches = 2) {
$length = count($data);
$nb_chunk = ceil($length / $nb_batches);
$chunks = array_chunk($data, $nb_chunk);
$batches = array();
foreach ($chunks as $chunk) {