This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user_agent = getenv("HTTP_USER_AGENT"); | |
if (strpos($user_agent, "Win") !== FALSE) | |
$os = "Windows"; | |
else (strpos($user_agent, "Mac") !== FALSE) | |
$os = "Mac" | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.page-item#ascolta= render_partial('music/home') | |
.page-item#guarda | |
%i.fa.fa-video-camera.fa-spin | |
:javascript | |
jQuery.get('/', {ajax: 'video/home'}, function(data, textStatus, xhr) { | |
jQuery('#guarda').html(data); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package MySQL_Collation_Fixer | |
* @version 1.6 | |
*/ | |
/* | |
Plugin Name: MySQL Collation fixer | |
Description: Change database tables collation to utf8_general__ci after DB upgrade | |
Version: 1.0 | |
Author: Federico Parodi - weLaika |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
initscript="/etc/init.d/myprocess" | |
mail=$(which mail) | |
destinatario="mail@example.com" | |
oggetto='Mail subject' | |
data=$(date) | |
limite=190 #must be an integer | |
process="" #if the process to restart differ from the name of the initscript, then set it here | |
#if $process isn't set than we set with the same name of the initscript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Aggiungere variabili configurabili | |
saved_dir=/root/saved | |
#Stampa l'utilizzo dello script | |
usage(){ | |
echo -e "Utilizzo: `basename $0` username" | |
exit 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Inizializzo l'array con tutti i nomi dei DB che mi interessano. | |
#+Inserire tra le parentesi tonde il nome del database da backuppare | |
#+rigorosamente uno per riga | |
#DB MySql | |
#E' possibile qui usare "all" come magic word per includere tutti i DB presenti. "all" va usata comunque come prima dell'elenco o meglio come unica | |
dbarray_mysql=( | |
foo | |
bar | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Install virtualbox: | |
# - http://www.virtualbox.org/wiki/Downloads | |
# - Download iso: http://releases.ubuntu.com/10.10/ | |
# - Create a new virtualbox using the iso as the install media | |
# - Change network adapter to bridged | |
# - Use ifconfig to get ip address | |
# | |
# Once you have a clean install of debien... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Queste action aggiungono nel profilo utente i campi personalizzati. | |
* L'HTML è ovviamente da personalizzare a piacere. | |
* $user è una variabile passata in automatico dalla action di WP. | |
* 'custom_info' è la parte personalizzabile...si dovrebbe capire come e dove ;) | |
***/ | |
add_action( 'show_user_profile', 'my_show_custom_user_info' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Install latest WordPress release in a specific path | |
#and don't bother any more! :) | |
if [[ ! $1 ]]; then | |
echo "Please, pass to me destination path as first argument! :)" | |
exit 1 | |
fi | |
path=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set a new vhost in lamp for Linux. | |
# .vhostrc is adaptable for LAMPP: just add in your | |
# /opt/lampp/etc/httpd.conf a section like this: | |
# | |
# # Virtual hosts | |
# Include etc/extra/sites-enabled/* | |
# | |
# and create such dir: | |
# $sudo mkdir /opt/lampp/etc/extra/sites-enabled/ |
OlderNewer