Skip to content

Instantly share code, notes, and snippets.

View Ferreiramg's full-sized avatar
💭
I may be slow to respond.

Luis Paulo Ferreiramg

💭
I may be slow to respond.
View GitHub Profile
<?php
require_once __DIR__ . '/vendor/autoload.php';
$client= popen('ping localhost' , 'w');
stream_set_blocking($client, 0);
$loop = React\EventLoop\Factory::create();
@Ferreiramg
Ferreiramg / errorHandler
Created July 28, 2013 17:47
set_error_handler(), custom class E_USER_*
<?php
class errorHandler {
public function __construct() {
$_t = $this;
set_error_handler(
function ($error, $msg, $file, $line) use ($_t) {
switch ($error) {
// ++$var
case E_NOTICE:
@Ferreiramg
Ferreiramg / autoload
Created July 9, 2013 00:52
psr-0 autoload
define("DS", DIRECTORY_SEPARATOR);
set_include_path(
implode(PATH_SEPARATOR, array(dirname(__DIR__), get_include_path())
));
$psr = array(
'\\' => DS,
'_' => DS
);
@Ferreiramg
Ferreiramg / vmconfig
Last active October 13, 2015 03:47
Instalar vmwaretools ubuntu
##Apos instalar o VMtools no VMware
##Habilitar VM>settings>Options>Shared Folder (add, always enabled) na VMware
sudo apt-get install make build-essential dkms
#Ubuntu 13.04 + vmware 8
# sudo apt-get install linux-headers-server
# cd /lib/modules/$(uname -r)/build/include/linux
# sudo ln -s ../generated/utsrelease.h
# sudo ln -s ../generated/autoconf.h