Skip to content

Instantly share code, notes, and snippets.

View sevein's full-sized avatar

Jesús García Crespo sevein

View GitHub Profile
||||||
||||||||
(||||||||)
||||||||
\______/
..--.| |.--..
.-`` | | ``-.
.` `-.__.-` `.
: _ :
qbAclPlugin arAclPlugin
qtAccessionPlugin arAccessionPlugin
qtOaiPlugin arOaiPlugin
qtSwordPlugin arSwordPlugin
qtTrilliumPlugin arTrilliumPlugin
sfAlouettePlugin arAlouettePlugin
sfAuditPlugin arAuditPlugin
sfCaribouPlugin arCaribouPlugin
sfColumbiaPlugin arColubmiaPlugin
sfDcPlugin arDcPlugin
@sevein
sevein / settings.yml
Created June 26, 2012 17:32
Qubit settings.yml example with default_culture = fr, default_timezone = US/Pacific
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/04-Settings
prod:
.settings:
no_script_name: false
logging_enabled: false
cache: true
dev:
@sevein
sevein / nested_set.php
Created June 21, 2012 22:07
Extra NestedSet functionality
<?php
/**
* Extra operations for nested sets
*/
public function moveToPrevSiblingOf($sibling, PropelPDO $con = null)
{
/*
if (!$this->isInTree())
<?php
/*
* This file is part of Qubit Toolkit.
*
* Qubit Toolkit is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@sevein
sevein / sql_debug.patch
Created May 18, 2012 21:53
SQL debug for Qubit
Index: vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/BasePeer.php
===================================================================
--- vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/BasePeer.php
+++ vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/BasePeer.php
@@ -283,7 +283,7 @@
$sql = 'INSERT INTO ' . $tableName
. ' (' . implode(',', $columns) . ')'
. ' VALUES (';
- // . substr(str_repeat("?,", count($columns)), 0, -1) .
+ // . substr(str_repeat("?,", count($columns)), 0, -1) .
@sevein
sevein / qubit-1.2-issue-2219.patch
Created January 13, 2012 19:38
Fix for issue 2219, change regular expression to capture ID properly
Index: apps/qubit/modules/contactinformation/actions/editComponent.class.php
===================================================================
--- apps/qubit/modules/contactinformation/actions/editComponent.class.php (revision 10667)
+++ apps/qubit/modules/contactinformation/actions/editComponent.class.php (working copy)
@@ -119,7 +119,7 @@
{
if (isset($item['id']))
{
- $this->contactInformation = QubitContactInformation::getById(preg_replace('/^(.*)(\d+)$/', '$2', $item['id']));
+ $this->contactInformation = QubitContactInformation::getById(preg_replace('/^.*\/(\d+)$/', '$1', $item['id']));
@sevein
sevein / migrate-1.2.0.patch
Created January 13, 2012 07:11
Set data version
Index: lib/task/migrate/MigrateTask.class.php
===================================================================
--- lib/task/migrate/MigrateTask.class.php (revision 10579)
+++ lib/task/migrate/MigrateTask.class.php (working copy)
@@ -204,6 +204,8 @@
$dir = dirname($originalFileName);
$migratedFileName = $dir.DIRECTORY_SEPARATOR.$migratedFileName;
+ $this->setDataVersion();
+
@sevein
sevein / qubit_dev.php.patch
Created January 11, 2012 18:16
Add another IP address to local ACL
Index: www/qubit-toolkit-svn/qubit_dev.php
===================================================================
--- www/qubit-toolkit-svn/qubit_dev.php (revision 10638)
+++ www/qubit-toolkit-svn/qubit_dev.php (working copy)
@@ -2,7 +2,7 @@
// this check prevents access to debug front controllers that are deployed by accident to production servers.
// feel free to remove this, extend it or make something more sophisticated.
-if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
+if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1', '192.168.1.10')))
@sevein
sevein / resetPasswordTask.class.php
Created January 10, 2012 20:41
Symfony task in Qubit to reset user passwods
<?php
/*
* This file is part of Qubit Toolkit.
*
* Qubit Toolkit is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*