Skip to content

Instantly share code, notes, and snippets.

View trq's full-sized avatar

Tony R Quilkey trq

  • thorpesystems
  • Sydney, Australia
View GitHub Profile
<?php
namespace Foo\SiteBundle\EventListener;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Gedmo\Sluggable\Util\Urlizer;
use Foo\SiteBundle\Entity\Category;
cms_module.controller.search:
class: "%cms_module.controller.search.class%"
arguments:
- @templating
calls:
- [setApiKey, ["%google_cse_key%"]]
- [setCxKey, ["%google_cse_cx%"]]
<?php
require_once '../include/conectar.php';
if (isset($_POST['borrar_id']) && is_array($_POST['borrar_id']))
{
foreach ($_POST['borrar_id'] as $id)
{
$result = $db->query("SELECT `direccion` FROM `imagenes` WHERE `id`='{$id}'");
while ($obj = $result->fetchObject())
<?php
class TimePeriod
{
protected $periodRepresentation;
protected function __construct($periodRepresentation)
{
$this->periodRepresentation = $periodRepresentation;
}
*
!.gitignore
(function() {
var calculator = angular.module('calculator', ['ui.check']);
calculator.controller('FormCtrl', ['$scope', '$http', function($scope, $http) {
$scope.selections = {
planType : null,
existingClient : null,
twins : null,
hospitalType : null,
(function() {
var calculator = angular.module('calculator', ['ui.check', 'ui.tick', 'mm.foundation', 'mm.foundation.tooltip', 'mm.foundation.modal']);
calculator.controller('ModalInstanceCtrl', ['$scope', '$modalInstance', function($scope, $modalInstance, email) {
$scope.user = {
email = email
}
$scope.ok = function () {
Im getting this error:
Notice: Undefined index: userId in /var/www/html/symfony2/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 688
class UsersType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
<?php
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
$app = new Cors($app, array(
// you can use array('*') to allow any headers
'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'),
// you can use array('*') to allow any methods
@trq
trq / scomposer
Last active August 29, 2015 14:08
#!/usr/bin/env bash
d=$(date +%s)
remote='some-aws-box'
dir="composer-$d.tmp"
if [ -f composer.json ]; then
ssh $remote mkdir "$dir"
scp composer.json $remote:"$dir"/composer.json