Skip to content

Instantly share code, notes, and snippets.

Avatar

Pedro Resende pedroresende

View GitHub Profile
View gist:8e84f9396f37dec2b23d5a7914738ee7
### 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:
View curl.php
<?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,
View HomeController.php
<?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
View PreCommitHook.php
#!/usr/bin/php
<?php
/**
* Git pre-commit hook for PHP code quality
* install with `<path-to-file> install`
*/
class PreCommitHook
{
/**
View paulo.php
public function setUserVariables($I)
{
if ($I->amIAdmin($I)) {
$URL = '/admin_herbals';
$saveButton_id = '#btupdate';
} else {
$URL = '/herbals';
$saveButton_id = '#submit';
}
}
View timeentry_timesheet.jsx
var ProjectList = React.createClass({
render: function() {
return (
<option value={this.props.data.projectId}>
{this.props.data.projectName}
</option>
);
}
});
View calendar.jsx
// 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];
View something.jsx
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 Jun 12, 2015
Controller "ez_content:viewLocation" for URI "/" is not callable.
View ViewController.php
<?php
namespace Cleverti\OverrideViewControllerBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use eZ\Bundle\EzPublishCoreBundle\Controller;
/**
* Description of ViewController
*
@pedroresende
pedroresende / Ezp23447Command.php
Last active Aug 29, 2015
Ezp23447Command.php
View 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;