Skip to content

Instantly share code, notes, and snippets.

var DjVu = (function () {
'use strict';
function DjVuScript() {
'use strict';
var DjVu = {
VERSION: '0.5.4',
IS_DEBUG: false,
setDebugMode: (flag) => DjVu.IS_DEBUG = flag
@mePy2
mePy2 / mostra_display.c
Created December 23, 2019 21:42
Programma Arduino corso Automazione G. Ferraris a.s. 2019/20.
/*
23/12/2019
Umberto Cerrato
Questo programma mostra un numero a due cifre su due display a sette segmenti collegati ad Arduino ai pin digitali (D0-D13)
(Programma non commentato)
*/
int a=66;
int dec_b, unit_a;
@mePy2
mePy2 / palette_generator.py
Last active November 9, 2020 10:54
Python script to convert GIMP exported palette to a .png color palette
from PIL import Image
array = bytearray()
colors = 0
with open("palette.txt") as palette:
for color in palette:
# print(color[1:7] + '\n')
data = bytearray.fromhex(color[1:7])
array += data
@mePy2
mePy2 / div class default – Download.txt
Created February 18, 2018 17:18
Download the inner content of the <div class="default">, if present.
<script>
function downloadHTML() {
var divDef = document.querySelector(&quot;div.default&quot;).innerHTML;
var title = &quot;<data:post.title/>&quot; + &quot;.html&quot;;
if (divDef) {
var pom = document.createElement(&#39;a&#39;);
pom.setAttribute(&#39;href&#39;, &#39;data:text/html;charset=utf-8,&#39; + encodeURIComponent(divDef));
pom.setAttribute(&#39;download&#39;, title);