Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Roberto Lo Giacco rlogiacco

💭
I may be slow to respond.
View GitHub Profile
View Clipper
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.PdfArray;
import com.itextpdf.text.pdf.PdfDictionary;
import com.itextpdf.text.pdf.PdfName;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
View Plastico.ino
#include "Arduino.h"
#include <FastLED.h>
#include <elapsedMillis.h>
#include <FormattingSerialDebug.h>
#define PIN_LEGENDA 2
#define PIN_PLASTICO 3
#define NUM_STANZE 13
#define LED_COUNT_LEGENDA 13
View CapTouch Test
int ref0, ref1; //reference values to remove offset
int ADCTouch_read(byte ADCChannel, int samples) {
long _value = 0;
for(int _counter = 0; _counter < samples; _counter ++)
{
pinMode(ADCChannel, INPUT_PULLUP);
analogRead(ADCChannel);
@rlogiacco
rlogiacco / freeRam.h
Created Sep 5, 2017
Arduino free RAM
View freeRam.h
int freeRam() {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
View Cubo3x3x3.ino
#include <Effects.h>
#include <Elapsed.h>
#include <Qube.h>
#define BUTTON_PIN 2
#define SIZE 3
const int pins[SIZE][SIZE] = { //
{ 3, 4, 5 }, // row 1
{ 6, 7, 8 }, // row 2
{ 9, 10, 11 } // row 3
View CircularBuffer.h
/*
CircularBuffer.h - Circular buffer library for Arduino.
Copyright (c) 2017 Roberto Lo Giacco. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
View final_3x3x3.ino
#include <Elapsed.h>
#include <Effects.h>
#include <Qube.h>
#include <FormattingSerialDebug.h>
#define BUTTON_PIN 2
#define SIZE 3
const int pins[SIZE][SIZE] = { //
{ 3, 4, 5 }, // row 1
{ 6, 7, 8 }, // row 2
@rlogiacco
rlogiacco / start.sh
Last active Jan 10, 2017
Docker 1.12 for Windows start script
View start.sh
#!/bin/bash
trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong... Press any key to continue..."' EXIT
VM=default
DOCKER_MACHINE=./docker-machine.exe
export PATH="/c/Program Files/Docker Toolbox:$PATH"
export HTTP_PROXY=10.235.34.235:3129
export HTTPS_PROXY=10.235.34.235:3129
for n in $(docker-machine ls --format {{.Name}}); do
@rlogiacco
rlogiacco / rsync-completed.sh
Last active Nov 11, 2016
Keep movies folder synchronized
View rsync-completed.sh
#!/bin/bash
exec 5>&1
SHARE="/mnt/TORRENT/completed"
LOCAL="/media/STORAGE/@temp"
FILES="/media/STORAGE/@new"
TIMESTAMP="$(date '+%d %h %y %H:%M:%S')"
LOCK="rsync-completed.lock"
# acquire lock
@rlogiacco
rlogiacco / 0_reuse_code.js
Created Apr 14, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.