Skip to content

Instantly share code, notes, and snippets.

@BenExile
BenExile / gist:2923448
Created June 13, 2012 11:03
Parsing FTP LIST Command Responses
var response = '', // FTP LIST response as a string
lines = response.trim().split("\r\n"),
parsed = [],
regexp = new RegExp(
'^([\\-dbclps])' + // Directory flag [1]
'([\\-rwxs]{9})\\s+' + // Permissions [2]
'(\\d+)\\s+' + // Number of items [3]
'(\\w+)\\s+' + // File owner [4]
'(\\w+)\\s+' + // File group [5]
'(\\d+)\\s+' + // File size in bytes [6]
@BenExile
BenExile / \PPI\Exception\Handler.php
Created November 14, 2011 00:12
Listener status concept
<?php
/**
* @author Paul Dragoonis ([email protected])
* @license http://opensource.org/licenses/mit-license.php MIT
* @package Core
* @link wwww.ppi.io
*/
namespace PPI\Exception;
class Handler implements ExceptionInterface {