Skip to content

Instantly share code, notes, and snippets.

View caferrari's full-sized avatar

Carlos A. Ferrari caferrari

View GitHub Profile
@caferrari
caferrari / nvm.js
Created April 24, 2013 14:56
Neverwinter classes
var characterData = [
{
'class' : 'Great Weapon Fighter',
'skills' : [
{
name: 'Reaping Strike',
type: 'atwill',
description: 'Hold the button to prepare a powerful sweeping strike that grows in strength the longer you charge it up. While charging your swing, you gain more Determination from taking damage.',
@caferrari
caferrari / pessoal.php
Last active December 12, 2015 04:49
Carregar funcionários do tocantins
<?php
$pages = 554;
$data = array();
$doc = new DOMDocument;
libxml_use_internal_errors(true);
for ($page = 1; $page <= $pages; $page++){
echo "Carregando página: $page" . PHP_EOL;
$body = file_get_contents("http://transparencia.to.gov.br/pessoal/?opt=3&n=&o=&p={$page}");
$body = utf8_encode(utf8_decode($body));
$doc->loadHTML($body);
@caferrari
caferrari / nginx.conf
Created January 25, 2013 17:56
/etc/nginx/nginx.conf
user www-data;
worker_processes 8;
worker_rlimit_nofile 32768;
error_log /var/log/nginx/error.log;
events {
worker_connections 512;
use epoll;
@caferrari
caferrari / nginx
Created January 25, 2013 17:39
/etc/logrotate.d/nginx
/var/log/nginx/*.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
@caferrari
caferrari / nginx
Created January 25, 2013 17:32
/etc/init.d/nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
wget http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5p3.tar.gz
tar -zxvf PDFlib-Lite-7.0.5p3.tar.gz
cd PDFlib-Lite-7.0.5p3/
./configure
make
sudo make install
sudo pecl install pdflib
echo "extension=pdf.so" | sudo tee /etc/php5/conf.d/pdf.ini
@caferrari
caferrari / especie.php
Created December 3, 2012 16:32
Especie
<?php
namespace Clinica\Controller;
use Core\Controller\AbstractController;
class Especie extends AbstractController
{
}
@caferrari
caferrari / AbstractForm.php
Created December 3, 2012 12:14
trait getInputFilter
<?php
namespace Core\Form;
use Zend\Form\Form;
abstract class AbstractForm extends Form
{
use \Core\Traits\getInputFilter;
}
@caferrari
caferrari / Loader.php
Created January 4, 2012 17:55
VorticePHP2 Loader
<?php
/**
* Simple loader class
*
* Usage:
* $loader = new Vortice\Common\Loader();
* $loader->register('Zend', './Zend/');
* $loader->register('Application', '../app/', 'Application\\');
* $loader->register('Vortice', './');
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.