Skip to content

Instantly share code, notes, and snippets.

View sevein's full-sized avatar

Jesús García Crespo sevein

View GitHub Profile
@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.
*
@sevein
sevein / share.diff
Created January 4, 2012 22:53
(de/un)capitalize
Index: src/MCPServer/share/mysql
===================================================================
--- src/MCPServer/share/mysql (revision 2275)
+++ src/MCPServer/share/mysql (working copy)
@@ -48,7 +48,7 @@
set @organizationAgent = 2;
INSERT INTO Agents (pk, agentIdentifierType, agentIdentifierValue, agentName, agentType)
VALUES (@archivematicaAgent, 'preservation system', 'Archivematica-0.8', 'Archivematica', 'software'),
- (@organizationAgent, 'repository code', 'ORG', 'Your Organization Name Here', 'organization')
+ (@organizationAgent, 'repository code', 'ORG', 'Your organization name here', 'organization')
@sevein
sevein / private.xml
Created December 30, 2011 05:48
KeyRemap4MacBook config file to make the backslash available in my keyboard from USA (using SPANISH_ISO in OSX).
<?xml version="1.0"?>
<root>
<item>
<name>get_backslash_spanish_keyboard</name>
<inputmodedetail_only>SPANISH_ISO</inputmodedetail_only>
<identifier>private.get_backslash_spanish_keyboard</identifier>
<autogen>--KeyToKey-- KeyCode::SPANISH_LESS_THAN, ModifierFlag::OPTION_R, KeyCode::SPANISH_ORDINAL_INDICATOR, ModifierFlag::OPTION_R</autogen>
</item>
</root
@sevein
sevein / gist:1456441
Created December 10, 2011 21:14
Change connection character set to utf8
Index: archivematicaCommon/lib/databaseInterface.py
===================================================================
--- archivematicaCommon/lib/databaseInterface.py (revision 2013)
+++ archivematicaCommon/lib/databaseInterface.py (working copy)
@@ -32,6 +32,8 @@
global separator
separator = "', '"
+DB_CONNECTION_OPTS = dict(db="MCP", read_default_file="/etc/archivematica/archivematicaCommon/dbsettings", charset="utf8")
+
@sevein
sevein / .htaccess
Created November 22, 2011 06:15
Qubit htaccess example file
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
RewriteBase /foobar
# we skip all files with .something
@sevein
sevein / gist:1377480
Created November 18, 2011 19:22
Remove cache
Index: apps/qubit/modules/menu/actions/listAction.class.php
===================================================================
--- apps/qubit/modules/menu/actions/listAction.class.php (revision 10336)
+++ apps/qubit/modules/menu/actions/listAction.class.php (working copy)
@@ -44,8 +44,8 @@
// Remove cache
if ($this->context->getViewCacheManager() !== null)
{
- $this->context->getViewCacheManager()->remove('@sf_cache_partial?module=menu&action=_browseMenu&sf_cache_key=settings');
@sevein
sevein / 404.patch
Created November 9, 2011 21:51
Workaround for qubit 1.2 to fix app error when 404 is shown
Index: apps/qubit/config/routing.yml
===================================================================
--- apps/qubit/config/routing.yml (revision 10293)
+++ apps/qubit/config/routing.yml (working copy)
@@ -15,7 +15,6 @@
param:
module: qtSwordPlugin
slug: { pattern: '[^;]+' }
- throw404: false
@sevein
sevein / patch.diff
Created November 7, 2011 20:25
Accession plugin as an optional plugin
Index: config/ProjectConfiguration.class.php
===================================================================
--- config/ProjectConfiguration.class.php (revision 10255)
+++ config/ProjectConfiguration.class.php (working copy)
@@ -26,7 +26,6 @@
{
$this->enablePlugins(array(
'qbAclPlugin',
- 'qtAccessionPlugin',
'sfAuditPlugin',
@sevein
sevein / index.html
Created November 6, 2011 22:48
Two lists of items
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Exercice 2</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://documentcloud.github.com/underscore/underscore.js"></script>
<script type="text/javascript" src="http://documentcloud.github.com/backbone/backbone.js"></script>