Skip to content

Instantly share code, notes, and snippets.

View casgin's full-sized avatar

Gianfranco Castro casgin

View GitHub Profile
@casgin
casgin / esempio-vhost
Created April 21, 2014 10:08
Esempio di Creazione di un Virtual Host con Apache su XAMPP e Windows
<VirtualHost *:80>
# Percorso della cartella che contiene i file della nostra applicazione Web
# da notare il carattere "/" al posto del "\" nella definizione del percorso
DocumentRoot "C:/webapps/test.local"
# nome del server che intendiamo creare
ServerName test.local
# Definisce una variabile di environment, che viene recuperata da PHP get_env(NOME_VARIABILE)
# Qui la documentazione http://us3.php.net/manual/en/function.getenv.php
@casgin
casgin / gist:a6e0120d1d34453f3f97
Last active August 29, 2015 14:10
Esempio Form HTML
<form id="frmEsempio" name="frmEsemio" action="esito.php" method="get">
Nome: <input type="text" id="fldNome" name="fldNome" /><br/>
Cognome: <input type="text" id="fldNome" name="fldNome" />
<select id="fldTipo" name="fldTipo">
<option value="attivo">Attivo</option>
<option value="nonattivo">Non Attivo</option>
</select>
@casgin
casgin / elenco-permessi-android.txt
Created December 17, 2015 10:08
Elenco Permessi Android
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
/**
* Indicator window with a spinner and a label
*
* @param {Object} args
*/
function createIndicatorWindow(args) {
var width = 180,
height = 50;
var args = args || {};
@casgin
casgin / Generare stringhe casuali
Created December 17, 2015 13:35
Generare stringhe casuali
/**
* Genera una stringa random
* @param {Object} length
* @param {Object} current
*/
function randomString(length,current){
current = current ? current : '';
return length ? randomString( --length ,
"abcdefghiklmnopqrstuvwxyz".charAt
( Math.floor( Math.random() * 60 ) ) + current ) : current;
http://www.105.net/upload/1437387883469.mp3
http://www.105.net/upload/1437387688998.mp3
http://www.105.net/upload/1445335794631.mp3
http://www.105.net/upload/1447779079239.mp3
http://www.105.net/upload/1442222811797.mp3
http://www.105.net/upload/1442839910756.mp3
@casgin
casgin / func-push-json.php
Created May 8, 2016 09:02
Function pushJSON
<?php
function pushJSON($ar) {
if (isset($_GET['callback']) && $_GET['callback'] != '') {
// === Caso di JSONP
// -----------------------------------------------------------------------
// --- VISUALIZZAZIONE / RESTITUZIONE OUTPUT
// -----------------------------------------------------------------------
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
@casgin
casgin / esempio-call-pushjson.php
Created May 8, 2016 09:12
Esempio richiamo funzione pushJSON
<?php
$arDati = array(
'nome' => 'Gianfranco',
'cognome' => 'Castro',
'email' => 'aaaa.bbb@gmail.com',
'elencoBrani' => array(
array(
'autore' => 'Vasco Rossi',
'titolo' => 'Alba Chirara',
'label' => 'EMI'
@casgin
casgin / esempio-pagina-con-ancore.html
Created September 17, 2016 11:32
Esempio di pagina con ancore
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Esempio ancore</title>
</head>
<body>
<h1>Tutorial su HTML</h1>
<nav>
<ul>
@casgin
casgin / iphones-media-query.css
Created September 18, 2016 10:01
Elenco delle CSS3 media query per i modelli di iPhone
/* ----------- iPhone 4 and 4S ----------- */
/* Portrait and Landscape */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2) {
}