Skip to content

Instantly share code, notes, and snippets.

View francescom's full-sized avatar

Francesco Munafò francescom

View GitHub Profile
@francescom
francescom / confirm-leave-page.js
Created November 15, 2021 11:35
JS to confirma page close/leave
window.onbeforeunload= (e)=> {e.returnValue="This page is asking you to confirm that you want to leave - data you have entered may not be saved."}
<?php
$def_font='HelveticaBold.ttf';
$err_font='HelveticaBold.ttf';
$font_folder='fonts/';
if( isset($_GET['w']) ) $w=my_txt_img_stsl($_GET['w']);
else $w=0;
if( isset($_GET['s']) ) $size=my_txt_img_stsl($_GET['s']);
else $size=127;
@francescom
francescom / install_codiad.sh
Last active July 17, 2019 10:02 — forked from rnauber/install_codiad.sh
this installs the browser-based editor Codiad
#installs the browser-based editor Codiad
DEST=~/codiad
ADDR_OUT=0.0.0.0:9876
/*ISTRUZIONI PER ACCENDERE/SPEGNERE RAFFREDDAMENTO/RISCALDAMENTO*/
if((long)(intervaltime-target)>=0){ //se tempo trascorso è maggiore del timer target
if(refrigeration==HIGH||heating==HIGH){ //se il raffreddamento o il riscaldamento sono accesi
if(refrigeration==HIGH){ //se il raffreddamento è acceso
target=intervaltime+cidle; //imposta il timer di standby raffreddamento
} else if(heating==HIGH){ //se il riscaldamento è acceso
target=intervaltime+hidle; //imposta il timer di standby riscaldamento
} else {
// Qui non dovrebbe passare
@francescom
francescom / comments_fun.js
Created May 9, 2012 11:20
Playing with C style comments
// Playing with C style comments and nested comments (you can AND and OR comments)
// (c) F. Munafò - Call them Munafò's comments? :)
// I kow this in not good practice. Yes, yes. It is just for fun.
//////////////// A Sample ////////////////