Skip to content

Instantly share code, notes, and snippets.

View fernandez14's full-sized avatar

Carlos Eduardo Fernández fernandez14

View GitHub Profile
@fernandez14
fernandez14 / gist:0e49b1941e1d2e5a3b85
Created November 12, 2014 16:25
Forking curl process
<?php
private function request($url, $payload) {
$cmd = "curl -X POST -H 'Content-Type: application/json'";
$cmd.= " -d '" . $payload . "' " . "'" . $url . "'";
if (!$this->debug()) {
$cmd .= " > /dev/null 2>&1 &";
}
@fernandez14
fernandez14 / ProgressBar.php
Created November 5, 2014 17:48
ConsoleKit Progress bar fix
<?php
/*
* This file is part of the ConsoleKit package.
*
* (c) 2012 Maxime Bouroumeau-Fuseau
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
(def bit-bucket-writer
(proxy [java.io.Writer] []
(write [buf] nil)
(close [] nil)
(flush [] nil)))
(defmacro noprint
"Evalua la expresiones dadas con todas las impresiones a *out* silenciadas."
[& forms]
`(binding [*out* bit-bucket-writer]