Skip to content

Instantly share code, notes, and snippets.

View marciuz's full-sized avatar

Marcello Verona marciuz

View GitHub Profile
@marciuz
marciuz / Revision maker
Last active August 29, 2015 14:19
Release of a VFront version
#!/bin/bash
VERSION="0.99.2"
DIR_VFRONT="vfront-${VERSION}"
cd /tmp
mkdir $DIR_VFRONT
cd $DIR_VFRONT
@marciuz
marciuz / README.md
Last active August 29, 2015 14:20
Light Social Button README
@marciuz
marciuz / uuid_term.features.inc.patch
Created October 14, 2015 14:57
uuid_term.features.inc.patch
--- /opt/build2/sites/all/modules/contrib/uuid_features/includes/uuid_term.features.inc.old 2015-10-14 16:54:02.109680899 +0200
+++ /opt/build2/sites/all/modules/contrib/uuid_features/includes/uuid_term.features.inc 2015-10-14 16:54:24.663219415 +0200
@@ -148,6 +148,7 @@
if (!empty($terms)) {
// Verify that term objects is saved before any references are resolved.
foreach ($terms as $data) {
+ $data = (array) $data;
$existing = entity_get_id_by_uuid('taxonomy_term', array($data['uuid']));
if (!count($existing)) {
$voc = taxonomy_vocabulary_machine_name_load($data['vocabulary_machine_name']);
@marciuz
marciuz / Guida qui
Last active January 26, 2016 19:59
Solr Drupal configuration
http://2bits.com/articles/configuring-apache-solr-4x-drupal-password-authentication.html
@marciuz
marciuz / eiponaha_install.sh
Created February 11, 2016 02:00
Installation procedure for the EIPonAHA website based on Nexteuropa Multisite 2.1
#!/bin/sh
# Procedure suggested for the correct activation of the EIP on AHA website
# Set the folder
EIPONAHA_DIR=/opt/eipaha
cd $EIPONAHA_DIR
# Install common
drush en eiponaha_common -y
# Install frontend and taxonomies: this take a while (3/5 minutes)
@marciuz
marciuz / install_modules.sh
Last active March 30, 2016 19:00
My list of standard modules for Drupal
drush dl \
fpa \
module_filter \
views \
ctools \
date \
pathauto \
admin_menu \
token \
@marciuz
marciuz / calendar_table.sql
Created April 5, 2016 22:17
The script create a calendar table, a useful tool for many databases. It is useful and quicker then create on the fly dates.
--
-- See https://www.brianshowalter.com/blog/calendar_tables
-- With 300 kb of
--
--
-- Create the table
--
CREATE TABLE calendar_table (
@marciuz
marciuz / cartodb-napoli2011.sql
Last active June 6, 2016 08:01
Esempi postgresql 3 candidati
--
-- Esempio con 3 candidati.
-- Viene codificato con (1,2,3) il candidato con la maggioranza nella sezione.
-- In caso di parità sulla percentuale (arrotondata con 0 decimali), restituisce 0.
--
SELECT
CASE
WHEN (de_magistris > lettieri AND de_magistris > morcone) THEN 1
WHEN (lettieri > de_magistris AND lettieri > morcone) THEN 2
WHEN (morcone > de_magistris AND morcone > lettieri) THEN 3
@marciuz
marciuz / file-extensions.txt
Created June 21, 2016 14:49
Drupal extensions for files
txt, doc, docx, xls, xlsx, odp, odt, ods, ppt, pptx, pdf, jpg, jpeg, gif, png, csv
#!/bin/bash
# Help menu
print_help() {
cat <<-HELP
This script is used to fix permissions of a Drupal installation
you need to provide the following arguments:
1) Path to your Drupal installation.
2) Username of the user that you want to give files/directories ownership.