#Mac OS X
#Disable window animations
sudo defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
#Enable repeat on keydown
sudo defaults write -g ApplePressAndHoldEnabled -bool false
ALTER TABLE xxxxxx | |
ADD created_at TIMESTAMP DEFAULT '0000-00-00 00:00:00', | |
ADD updated_at TIMESTAMP DEFAULT '0000-00-00 00:00:00'; | |
CREATE TRIGGER xxxxxx_create BEFORE INSERT ON `xxxxxx` | |
FOR EACH ROW SET NEW.created_at = NOW(), NEW.updated_at = NOW(); | |
CREATE TRIGGER xxxxxx_update BEFORE UPDATE ON `xxxxxx` | |
FOR EACH ROW SET NEW.updated_at = NOW(), NEW.created_at = OLD.created_at; |
SELECT * | |
FROM TABELLA1 | |
LEFT JOIN TABELLA2 | |
ON TABELLA1.CAMPO1 = TABELLA2.CAMPO2 | |
UNION | |
SELECT * | |
FROM TABELLA1 | |
RIGHT JOIN TABELLA2 | |
ON TABELLA1.CAMPO1 = TABELLA2.CAMPO2 | |
WHERE TABELLA1.CAMPO1 IS NULL |
background: #ffffff; | |
/* Old browsers */ | |
/* IE9 SVG, needs conditional override of 'filter' to 'none' */ | |
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM5OWNjZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); | |
background: -moz-linear-gradient(top, #ffffff 0%, #99ccff 100%); /* FF3.6+ */ | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#99ccff)); /* Chrome,Safari4+ */ | |
background: -webkit-linear-grad |
upstream rails { | |
server 127.0.0.1:3000; | |
server 127.0.0.1:3001; | |
server 127.0.0.1:3002; | |
} | |
server { | |
listen 80; | |
server_name ~^(?<domain>[^\.]+)\.(?<tld>[^\.]+)$; | |
root /var/www/vhosts/$domain.$tld/htdocs; |
CREATE TABLE `comuni` ( | |
`id` smallint(4) NOT NULL, | |
`comune` varchar(48) NOT NULL DEFAULT '', | |
`prefisso` char(4) NOT NULL DEFAULT '', | |
`cap` char(5) NOT NULL DEFAULT '', | |
`codice_istat` char(6) NOT NULL DEFAULT '', | |
`codice_catasto` char(4) NOT NULL DEFAULT '', | |
`id_provincia` tinyint(3) NOT NULL, | |
`sigla` char(2) NOT NULL DEFAULT '', | |
`provincia` varchar(48) NOT NULL DEFAULT '', |
cd ~/Library/Application\ Support/Sublime\ Text\ 3/ | |
mkdir ~/Dropbox/Sublime | |
mv Installed\ Packages ~/Dropbox/Sublime | |
mv Packages ~/Dropbox/Sublime | |
ln -s ~/Dropbox/Sublime/Installed\ Packages | |
ln -s ~/Dropbox/Sublime/Packages |
usermod -a -G www-data user | |
find /var/www/website.it/ -type d -print0 | xargs -0 chmod 775 | |
find /var/www/website.it/ -type f -print0 | xargs -0 chmod 664 | |
chown /var/www/website.it/ | |
chmod g+s /var/www/website.it/ |
#!/bin/bash | |
EXPECTED_ARGS=3 | |
E_BADARGS=65 | |
MYSQL=`which mysql` | |
Q1="CREATE DATABASE IF NOT EXISTS $1;" | |
Q2="GRANT USAGE ON *.* TO $2@localhost IDENTIFIED BY '$3';" | |
Q3="GRANT ALL PRIVILEGES ON $1.* TO $2@localhost;" | |
Q4="FLUSH PRIVILEGES;" |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers