Skip to content

Instantly share code, notes, and snippets.

Avatar

Davide Maggio DVDAndroid

  • 08:06 (UTC +02:00)
View GitHub Profile
@DVDAndroid
DVDAndroid / icon.xml
Created September 11, 2015 09:15
android m developer preview platlogo
View icon.xml
<?xml version="1.0" encoding="utf-8"?>
<vector android:height="48.0dip" android:width="48.0dip" android:viewportWidth="48.0" android:viewportHeight="48.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#fff57c00" android:pathData="M24.0,2.0C11.8,2.0 2.0,11.8 2.0,24.0c0.0,6.1 2.5,11.6 6.4,15.6L39.6,8.4C35.6,4.5 30.1,2.0 24.0,2.0z" />
<path android:fillColor="#ffff9800" android:pathData="M39.6,8.4L8.4,39.6c4.0,4.0 9.5,6.4 15.6,6.4c12.2,0.0 22.0,-9.8 22.0,-22.0C46.0,17.9 43.5,12.4 39.6,8.4z" />
<path android:fillColor="#fff57c00" android:pathData="M45.9,25.9L34.0,14.0L14.0,34.0l11.9,11.9C36.5,45.0 45.0,36.5 45.9,25.9z" android:fillAlpha="0.33" />
<path android:fillColor="#ffffffff" android:pathData="M24.0,24.0c0.0,0.0 0.0,2.2 0.0,5.0s0.0,5.0 0.0,5.0l10.0,-10.0L34.0,14.0L24.0,24.0z" />
<path android:fillColor="#ffeeeeee" android:pathData="M24.0,24.0L14.0,14.0l0.0,10.0l10.0,10.0c0.0,0.0 0.0,-2.2 0.0,-5.0S24.0,24.0 24.0,24.0z" />
<path android:fillColo
View box-shadow-material-design.css
div {
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12), 0px 3px 1px -2px rgba(0, 0, 0, 0.2);
}
@DVDAndroid
DVDAndroid / main.kt
Created May 28, 2019 10:42
Generazione codice fiscale in Kotlin
View main.kt
val alfabeto = CharRange('A', 'Z').toList()
val vocali = arrayOf('A', 'E', 'I', 'O', 'U')
val caratteriDispari = hashMapOf(
'0' to 1, '1' to 0, '2' to 5, '3' to 7, '4' to 9, '5' to 13,
'6' to 15, '7' to 17, '8' to 19, '9' to 21, 'A' to 1, 'B' to 0,
'C' to 5, 'D' to 7, 'E' to 9, 'F' to 13, 'G' to 15, 'H' to 17,
'I' to 19, 'J' to 21, 'K' to 2, 'L' to 4, 'M' to 18, 'N' to 20,
'O' to 11, 'P' to 3, 'Q' to 6, 'R' to 8, 'S' to 12, 'T' to 14,
'U' to 16, 'V' to 10, 'W' to 22, 'X' to 25, 'Y' to 24, 'Z' to 23
@DVDAndroid
DVDAndroid / AttributesDescriptorsDSL.kt
Created November 7, 2019 13:55
AttributesDescriptorsBuilder DSL for Intellij Plugins
View AttributesDescriptorsDSL.kt
import com.intellij.openapi.editor.colors.TextAttributesKey
import com.intellij.openapi.options.colors.AttributesDescriptor
import java.util.*
fun attributesDescriptors(block: AttributesDescriptorsBuilder.() -> Unit): Array<AttributesDescriptor> =
AttributesDescriptorsBuilder().apply(block).build()
@DslMarker
annotation class DescriptorDsl
@DVDAndroid
DVDAndroid / google_youtube_cookies.js
Created November 7, 2020 17:15
tampermonkery userscript to remove google and youtube popups
View google_youtube_cookies.js
// ==UserScript==
// @name Google&Youtube consent cookie inject
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.google.com/*
// @match https://www.youtube.com/*
// @grant none
// @run-at document-start
@DVDAndroid
DVDAndroid / clean_gradle.py
Last active April 26, 2021 13:36
clear project dirs
View clean_gradle.py
import os
import subprocess
import datetime
import math
from pathlib import Path
import shutil
def convert_size(size_bytes):
if size_bytes == 0:
@DVDAndroid
DVDAndroid / Epg.py
Last active April 16, 2022 14:18
epg-downloader guidatv sky
View Epg.py
import json
import re
from datetime import datetime, timedelta
import requests
CHANNELS_XML = "https://raw.githubusercontent.com/iptv-org/epg/master/sites/guidatv.sky.it/guidatv.sky.it_it.channels.xml"
CHANNELS_XML_REGEX = "<channel.+xmltv_id=\"(.+)\" site_id=\"(.+)\">(.+)</channel>"
PROGRAMMES = []
@DVDAndroid
DVDAndroid / 0ffmpeg-recorder.sh
Last active May 24, 2022 09:06
cron ffmpeg recorder docker
View 0ffmpeg-recorder.sh
#!/bin/sh
url_parse() {
if [[ $1 == http* ]] ;
then
URL=$1
else
# variabile 1 : dal 0 carattere : prendi 1
channel=${1:0:1}
out=$(wget -qO- https://apid.sky.it/vdp/v1/getLivestream?id=${channel} | jq --raw-output .streaming_url)