Skip to content

Instantly share code, notes, and snippets.

@asanchez75
asanchez75 / gist:4467682
Created January 6, 2013 14:51
instalacion postgis centos 5.7
yum install postgis geos proj --enablerepo=epel
yum install postgresql postgresql-server --disablerepo=updates --disablerepo=base
==============================================
@asanchez75
asanchez75 / my.cnf
Created March 14, 2013 22:47 — forked from petemcw/my.cnf
# The MySQL database server configuration file.
#
# DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM
#
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
@asanchez75
asanchez75 / python
Created March 23, 2013 14:25
starting python
1. to install a egg
easy_install http://arshaw.com/scrapemark/downloads/scrapemark-0.9-py2.7.egg
2. make
2.1 install ez_setup.py
https://pypi.python.org/pypi/setuptools
@asanchez75
asanchez75 / gist:5293245
Created April 2, 2013 15:45
recursive_array_replace
// Recursive String Replace - recursive_array_replace(mixed, mixed, array);
function recursive_array_replace($find, $replace, $array){
if (!is_array($array)) {
return str_replace($find, $replace, $array);
}
$newArray = array();
foreach ($array as $key => $value) {
$newArray[$key] = recursive_array_replace($find, $replace, $value);
}
return $newArray;
@asanchez75
asanchez75 / template.php
Created May 3, 2013 19:52
display metatags for facebook
<?php
/**
* @file
* This file is empty by default because the base theme chain (Alpha & Omega) provides
* all the basic functionality. However, in case you wish to customize the output that Drupal
* generates through Alpha & Omega this file is a good place to do so.
*
* Alpha comes with a neat solution for keeping this file as clean as possible while the code
* for your subtheme grows. Please read the README.txt in the /preprocess and /process subfolders
drush php-eval 'node_access_rebuild();'
<?php
// Author: John Wright
// Website: http://johnwright.me/blog
// This code is live @
// http://johnwright.me/code-examples/sparql-query-in-code-rest-php-and-json-tutorial.php
function getUrlDbpediaAbstract($term)
{
$format = 'json';
@asanchez75
asanchez75 / my.cnf
Created May 19, 2013 21:04
my.cnf settings for Drupal 7 under Linux Mint 14 with MySQL 5.5.31 and PHP 5.4.6
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
<?php
function node404_menu_site_status_alter(&$menu_site_status, $path) {
// Allow access to my_module/authentication even if site is in offline mode.
$exceptions = array('add', 'edit');
$item = menu_get_item();
// for node/% paths
if ($item['original_map'][0] == 'node' && isset($item['original_map'][1])) {
if (!is_numeric($item['original_map'][1]) && !in_array($item['original_map'][1], $exceptions)) {
/**
* Adds method arg to the Drupal object for grabbing url args
*
* @author Aaron Klump, In the Loft Studios, LLC
* @see http://www.intheloftstudios.com
* @see http://gist.github.com/3078482
*
* For use in a theme or module add the following to your .info file
* @code
* scripts[] = [path to js dir]/drupal.arg.js