Skip to content

Instantly share code, notes, and snippets.

View gestadieu's full-sized avatar

Gerald Estadieu gestadieu

View GitHub Profile
@gestadieu
gestadieu / steppermotor_blynk_firmware.ino
Created March 23, 2022 12:37
Basic to control a motor through Blynk (app or web)
// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID ""
#define BLYNK_DEVICE_NAME "WemosD1 Motor Control"
#define BLYNK_AUTH_TOKEN ""
// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
@gestadieu
gestadieu / autostart
Created January 20, 2017 06:40
Kiosk Mode for Raspbian Jessie (2017-01-11) with PIXEL, using Chromium browser
# autostart file in ~./.config/lxsession/LXDE-pi/
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
#@point-rpi
@xset s off #no screensaver
@xset -dpms #no energy saving
@xset s noblank
@sed -i 's/"exited_cleanly":false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
@chromium-browser --incognito --noerrdialogs --disable-translate --kiosk {{your-url-here}}
@gestadieu
gestadieu / README.md
Last active July 19, 2023 23:37
Raspberry Pi Control Dashboard

Requirement: node-red-dashboard. Obviously you will need a Raspberry Pi too!

This is a simple but very useful dashboard to control a Raspberry Pi (similar to Cayenne dashboard for RPi), it includes so far:

  • CPU Temperature
  • CPU Load %
  • Free RAM %
  • Disk Usage %
  • Actions: Shutdown and Reboot buttons

Feel free to fork and and more stuff ;-)

@gestadieu
gestadieu / jpgs2gif.sh
Last active December 31, 2016 09:28
Aminated Gif - convert
# loop 0: always looping
convert -delay 80 -loop 0 hny/*.jpg hny.gif
#convert -delay 100 -loop 0 img1.png img2.png img3.png -delay 500 img4.png animation2.gif
#convert hny.gif -resize 1080x hny2.gif
#convert hny.gif -resize 50% hny2.gif
# http://infoheap.com/crop-image-using-imagemagick-convert/
@gestadieu
gestadieu / timelapse2MP4.sh
Created December 31, 2016 09:27
Timelapse - JPEG to MP4 with avconv
# standard framerate 25
# output to hd720 (check documentation for more https://libav.org/avconv.html)
# on Mac, can rename jpg files with Automator
avconv -framerate 25 -i sourcefolder/image-%05d.jpg -s:v hd720 all.mp4
@gestadieu
gestadieu / mkr1000_ledstrip.ino
Last active June 10, 2016 13:07
Create light animation with a led strip or Neopixel on MKR1000
#include <Adafruit_NeoPixel.h>
#define NUM_LEDS 77 // Number of LEDs
#define PIN_LEDS 2
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN_LEDS, NEO_GRB + NEO_KHZ800);
int delayPixel = 200;
void setup() {
@gestadieu
gestadieu / mkr1000_blinkled.ino
Created June 10, 2016 11:07
Arduino/Genuino MKR1000 - LED Blink
/*
LED Blink
Turns on an LED on for one second, then off for one second, repeatedly.
*/
// internal led connected on pin 6 on the MKR1000
int PIN_LED = 6;
void setup() {
pinMode(PIN_LED, OUTPUT);
}
@gestadieu
gestadieu / sfWidgetFormChoiceAutocomplete
Created June 18, 2010 02:28
Symfony Form widget to manage many-to-many relationship
<?php
/**
* sfWidgetFormChoiceAutocomplete represents a multiple select displayed as an autocomplete input and a list of checkboxes.
*
*
* @package symfony
* @subpackage widget
* @author Gerald Estadieu <gestadieu@usj.edu.mo>
* @version
*/
#!/bin/bash
SYMFREPO="git://symfony-git.git.sourceforge.net/gitroot/symfony-git/symfony-git"
DBUSER="root"
DBPASS=""
VENDOR_DIR="lib/vendor/symfony"
if [ -z "$DBPASS" ]; then
echo edit setupsymfony.sh to add your mysql password on line 4: DBPASS=\"password\"
exit
<?php
class sfWidgetFormSchemaFormatterDef extends sfWidgetFormSchemaFormatter
{
protected
$rowFormat = '<div class="row %row_class%">%label%%field%%help%%hidden_fields%</div>',
$helpFormat = '<span>%help%</span>',
$errorRowFormat = '%errors%',
$errorListFormatInARow = '<ul>%errors%</ul>',
$errorRowFormatInARow = '<li>%error%</li>',