Skip to content

Instantly share code, notes, and snippets.

View mattocchi's full-sized avatar

Mirco Attocchi mattocchi

View GitHub Profile
@mattocchi
mattocchi / start-ffmpeg.sh
Created May 23, 2020 18:33
use ffmpeg (raspberry pi or linux) to stream to youtube
# Scenario A
# VIDEO IN: IP CAM
# AUDIO IN: USB AUDIO CARD
@mattocchi
mattocchi / test-img-size.html
Created March 19, 2020 07:55
leggere dimensioni originali immagine da javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JavaScript Find Real Image Width and Height</title>
<script>
function imgSize() {
var myImg = document.querySelector("#sky");
@mattocchi
mattocchi / tomcat.service
Last active April 17, 2019 15:37
systemd unit service user vanilla tomcat
# sudo cp tomcat.service /etc/systemd/system -i
# sudo nano /etc/systemd/system/tomcat.service
# sudo systemctl daemon-reload
# sudo systemctl enable tomcat
# sudo systemctl start tomcat
# systemctl status tomcat
# sudo systemctl restart tomcat
[Unit]
Description=tomcat
@mattocchi
mattocchi / gist:f0e54cbafbbd76df595947e9db21885e
Created August 21, 2018 10:04
Errori Arrotondamento Float
var x = .3 - .2; // trenta centesimi meno venti centesimi
var y = .2 - .1; // venti centesimi meno dieci centesimi
x == y; // => false
x == .1; // => false: .3-.2 non è uguale a .1
y == .1 // => true: .2-.1 è uguale a .1
@mattocchi
mattocchi / Code128_Str
Last active February 7, 2018 12:57
VBA Code128_Str
' *** Made By Michael Ciurescu (CVMichael) ***
'Modified by Paulo Cunha (pcunha) to work with char128.ttf on word or excel on 16/05/2011
'the font at in http://grandzebu.net/index.php?page=/informatique/codbar-en/code128.htm
' References:
' http://www.barcodeman.com/info/c128.php3
Private Enum eCode128Type
eCode128_CodeSetA = 1
@mattocchi
mattocchi / CorrectNokiaContacts
Created February 4, 2017 09:37
Nokia PCSuite and Outlook (Sync Other Phone Number issue)
' Code for post this http://mircoattocchi.blogspot.it/2009/01/nokia-pcsuite-and-outlook-other-phone.html
Sub CorrectNokiaContacts()
  ' This procedure retrieves all contacts from the Outlook
  ' Contacts folder and for eatch Contact move the
  ' OtherTelephoneNumber content on MobileTelephoneNumber or BusinessTelephoneNumber
  ' based on how OtherTelephoneNumber ("3" or "+393" or "+39 3")
  ' when MobileTelephoneNumber and BusinessTelephoneNumber are empty.
  '
  ' Configure your Area Code:
  Dim AreaCode As String
@mattocchi
mattocchi / tomcat.sh
Last active October 3, 2019 09:47
Tomcat Startup Script
#!/bin/bash
#
# Author: Mirco Attocchi
#
# Tomcat Startup Script
# thanks to http://www.akadia.com/download/soug/tomcat/html/tomcat_startscript.html
# thanks to http://askubuntu.com/questions/223944/how-to-automatically-restart-tomcat7-on-system-reboots
CATALINA_HOME=/home/cloud/apache-tomcat-7.0.82; export CATALINA_HOME
JAVA_HOME=/home/cloud/jdk1.7.0_75; export JAVA_HOME