Skip to content

Instantly share code, notes, and snippets.

View massiws's full-sized avatar

Massimo Simonini massiws

  • Simonini informatica
  • Milan, Italy
  • X @massiws
View GitHub Profile
@massiws
massiws / toggle_div.html
Created July 31, 2014 00:16
JQUERY: Toggle DIVs with radio buttons
<html>
<head>
<title>Toggle DIVs with radio buttons</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$("[name=toggler]").click(function(){
$('.hide').hide();
$("#div-" + $(this).val()).show();
});
@massiws
massiws / gist:9593008
Last active January 25, 2025 12:47
PHP Count the number of working days between two dates.
<?php
/**
* Count the number of working days between two dates.
*
* This function calculate the number of working days between two given dates,
* taking account of the Public festivities, Easter and Easter Morning days,
* the day of the Patron Saint (if any) and the working Saturday.
*
* @param string $date1 Start date ('YYYY-MM-DD' format)