View calendario_produzione.php
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 | |
/** | |
* This script generates a simple list of days formatted as "Dayofweek day(numeric) Month" | |
* I use this calendar as blueprint for my reports. | |
* 4th revision with better formatting and some refactoring | |
*/ | |
define("TOTAL_DAYS", 150); | |
setlocale(LC_ALL, 'it_IT', 'it', 'IT', 'ita', 'italian'); |
View parlamentari.php
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 | |
$parlamentare["camera"] = array('id' => "302940", 'nome' => "ABRIGNANI Ignazio", 'procedimento' => "Indagato per dissipazione post-fallimentare"); | |
$parlamentare["camera"] = array('id' => "34960", 'nome' => "ADORNATO Ferdinando"); | |
$parlamentare["camera"] = array('id' => "305782", 'nome' => "AGOSTINELLI Donatella"); | |
$parlamentare["camera"] = array('id' => "302873", 'nome' => "AGOSTINI Luciano"); | |
$parlamentare["camera"] = array('id' => "305840", 'nome' => "AGOSTINI Roberta"); | |
$parlamentare["camera"] = array('id' => "306300", 'nome' => "AIELLO Ferdinando"); | |
$parlamentare["camera"] = array('id' => "305575", 'nome' => "AIRAUDO Giorgio"); | |
$parlamentare["camera"] = array('id' => "306112", 'nome' => "ALBANELLA Luisella"); | |
$parlamentare["camera"] = array('id' => "305518", 'nome' => "ALBERTI Dino"); |
View legislature.php
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 | |
/* | |
Data is organized in two arrays: $orientamento keeps the political orientation as: | |
- SX = left | |
- CSX = centre-left | |
- Centro = centre | |
- CDX = centre-right | |
- Misto = mixed group | |
The second array is $gruppo_parlamentare, keeps track of date, chamber, name of party in the coalition. | |
The value assigned is the number of seats in the given chamber. |
View laravel_query_logger.html
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
<script type="text/javascript"> | |
var queries = {{ json_encode(DB::getQueryLog()) }}; | |
console.log('/****************************** Database Queries ******************************/'); | |
console.log(' '); | |
$.each(queries, function(id, query) { | |
console.log(' ' + query.time + ' | ' + query.query + ' | ' + query.bindings[0]); | |
}); | |
console.log(' '); | |
console.log('/****************************** End Queries ***********************************/'); | |
</script> |
View createFromArray.php
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 | |
$data = [ | |
[ 'id' => 0 ], | |
[ 'id' => 1 ], | |
[ 'id' => 2, | |
'children' => [ | |
[ 'id' => 3 ], | |
[ 'id' => 4, | |
'children' => [ |
View highlight.php
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 | |
// http://www.webdevdoor.com/php/highlight-search-keyword-string-function/#comment-445598 | |
function highlight($haystack, $needle, $color = ‘#F00′) | |
{ | |
return preg_replace("/($needle)/i", sprintf('<span style="color: %s">$1</span>', $color), $haystack); | |
} |
View lightbox4all.user.js
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
// ==UserScript== | |
// @name Lightbox 4 all | |
// @namespace http://vjandrea.net | |
// @description Open all images in lightbox | |
// @require http://lokeshdhakar.com/projects/lightbox2/js/jquery-1.11.0.min.js | |
// @require http://lokeshdhakar.com/projects/lightbox2/js/lightbox.js | |
// @version 1.3.1 | |
// @grant none | |
// ==/UserScript== | |
View money_round.inc.php
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
/* | |
* Rounds to the nearest 5 cents | |
* Modified from @dancameron's version | |
* For $mode values see http://php.net/manual/en/function.round.php | |
* | |
* @param float $amount | |
* @param int $mode (default = PHP_ROUND_HALF_UP) | |
* @return float | |
*/ | |
function round_money($amount = 0.0, $mode = PHP_ROUND_HALF_UP) { |
View laravel_email.php
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
// $ composer require laravelcollective/html | |
{{ HTML::mailto('a@b.c') }} |
View .htaccess
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
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
# Redirect Trailing Slashes If Not A Folder... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)/$ /$1 [L,R=301] |
OlderNewer