Skip to content

Instantly share code, notes, and snippets.

View pedroresende's full-sized avatar

Pedro Resende pedroresende

View GitHub Profile
### Keybase proof
I hereby claim:
* I am pedroresende on github.
* I am pedroresende (https://keybase.io/pedroresende) on keybase.
* I have a public key ASBFtQIqhM5b5tcMY2nC0gshB3ubRXgUlGF1UZm9GVmFcwo
To claim this, I am signing this object:
<?php
$time_start = microtime(true);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.fix_trailing_old_variables.kinternal.kwankodev.net/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
<?php
// src/Controller/HomeController.php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Service\ConfigGenerator;
use App\Service\StoreFactory;
class HomeController
@pedroresende
pedroresende / PreCommitHook.php
Created February 2, 2018 10:55 — forked from joaoinacio/PreCommitHook.php
php QC pre-commit hook
#!/usr/bin/php
<?php
/**
* Git pre-commit hook for PHP code quality
* install with `<path-to-file> install`
*/
class PreCommitHook
{
/**
public function setUserVariables($I)
{
if ($I->amIAdmin($I)) {
$URL = '/admin_herbals';
$saveButton_id = '#btupdate';
} else {
$URL = '/herbals';
$saveButton_id = '#submit';
}
}
var ProjectList = React.createClass({
render: function() {
return (
<option value={this.props.data.projectId}>
{this.props.data.projectName}
</option>
);
}
});
// these are labels for the days of the week
var cal_days_labels = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
// these are human-readable month name labels, in order
var cal_months_labels = ['January', 'February', 'March', 'April',
'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'];
// these are the days of the week for each month, in order
var cal_days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var Content = React.createClass({
render: function() {
var view = "/projects/view/" + this.props.content.id;
var edit = "/projects/edit/" + this.props.content.id;
var remove = "/projects/delete/" + this.props.content.id;
return (
<tr role="row" className="even">
<td className="sorting_1"><a href={ edit }>{ this.props.content.id }</a></td>
<td>{this.props.content.client}</td>
<td>{this.props.content.name}</td>
@pedroresende
pedroresende / ViewController.php
Created June 12, 2015 10:03
Controller "ez_content:viewLocation" for URI "/" is not callable.
<?php
namespace Cleverti\OverrideViewControllerBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use eZ\Bundle\EzPublishCoreBundle\Controller;
/**
* Description of ViewController
*
@pedroresende
pedroresende / Ezp23447Command.php
Last active August 29, 2015 14:07
Ezp23447Command.php
<?php
namespace Cleverti\EZP23447Bundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;