Skip to content

Instantly share code, notes, and snippets.

View filippomangione's full-sized avatar

Filippo Mangione filippomangione

  • Boolean Careers
  • Milano
View GitHub Profile
@filippomangione
filippomangione / basename.js
Created May 22, 2014 09:55
Returns trailing name component of path.
var path = '/m/static/media/file-8861b49be6e21675f87b174cb824d79f.jpg';
var basename = path.split(/[\\/]/).pop();
@filippomangione
filippomangione / array_pluck.php
Created May 4, 2014 10:06
An equivalent to Underscore.js pluck method.
<?php
$stooges = [
["name" => "Moe", "age" => 40],
["name" => "Larry", "age" => 50],
["name" => "Curly", "age" => 60],
];
function array_pluck ($toPluck, $arr) {
return array_map(function ($item) use ($toPluck) {