Skip to content

Instantly share code, notes, and snippets.

View domenicomonaco's full-sized avatar
🎯
Focusing

Domenico Monaco domenicomonaco

🎯
Focusing
View GitHub Profile
@domenicomonaco
domenicomonaco / gist:1621289
Created January 16, 2012 15:11
REWF A a Int a
/*
AdrianH
re: what is the difference between int& and int
hello,
In some code i see some definitions like that "int& a" and I wonder what is the difference with "int a".
By the way, is it different between "char* c" and "char *c "
Thank you very much and best regards,
${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
// add this into your Template.php drupal theme
function getTerm($vid, $link, $node, $tagsymbol, $labelname) {
foreach((array)$node->taxonomy as $term){
if ($term->vid == $vid){
if ($link){
$link_set[] = l((($tagsymbol)?$tagsymbol:'') . $term->name, taxonomy_term_path($term));
} else {
$link_set[] = (($tagsymbol)?$tagsymbol:'') . $term->name;
}
@domenicomonaco
domenicomonaco / TypeError: coercing to Unicode: need string or buffer, long found
Created November 24, 2010 14:33
def __unTypeError: coercing to Unicode: need string or buffer, long foundicode__(self):
Errore:
in Admin o any other query to models
TypeError: coercing to Unicode: need string or buffer, long found
solution:
da
def __unicode__(self):
return self.id
@domenicomonaco
domenicomonaco / gist:653258
Created October 29, 2010 09:59
Local_Setting_Python
#
# You can put any custom options you would normally want in settings.py into
# this file. If you want to add middleware or applications, precede a setting
# name with "EXTRA_".
# Use a local PostgreSQL database.
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = ''
DATABASE_USER = ''
DATABASE_PASSWORD = ''
@domenicomonaco
domenicomonaco / Apache
Created October 20, 2010 14:59
Apache
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
or
sudo /etc/init.d/apache2 restart
@domenicomonaco
domenicomonaco / Linux - ImageMagick
Created October 16, 2010 07:36
Ridimensionare molte immagini con Ubuntu Gnu/Linux - ImageMagick
sudo apt-get install imagemagick
cd /home/user/photos/Vacanze
mkdir ridimensionate
cp /home/user/photos/Vacanze/* /home/user/photos/Vacanze/ridimensionate/
cd ridimensionate
mogrify -resize 640 *.jpg
mogrify -resize 640×480 *.jpg
@domenicomonaco
domenicomonaco / gist:628129
Created October 15, 2010 12:52
Python Envrioment & Django
sudo apt-get install apache2 libapache2-mod-php5 php5-gd
sudo apt-get install libapache2-mod-security php5-ldap php5-odbc
sudo apt-get install openssh-server unattended-upgrades
sudo apt-get install unzip zip aspell-en aspell-fr aspell-de aspell-es
sudo apt-get install curl php5-curl php5-xmlrpc
sudo apt-get install clamav-base clamav-freshclam clamav
sudo apt-get install mysql-server php5-mysql
python manage.py reset_db --router=default
python manage.py syncdb
python manage.py runserver_plus