Skip to content

Instantly share code, notes, and snippets.

#include "secrets.h"
#include "ThingSpeak.h"
#include <DHTesp.h>
#include <ESP8266WiFi.h>
#include <SFE_BMP180.h>
#include <Wire.h>
#define BUILTIN_LED1 D4 //GPIO2
#define BUILTIN_LED2 D0 //GPIO16
#define DHTpin D5 //GPIO14
#define SECRET_SSID "default"
#define SECRET_PASS ""
#define BUILTIN_LED1 D4 //GPIO2
#define BUILTIN_LED2 D0 //GPIO16
#define MUX_A D5 //GPIO14
#define MUX_B D2 //GPIO4
#define MUX_C D1 //GPIO5
#include <DHTesp.h>
#include <DHTesp.h>
DHTesp dht;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println();
Serial.println("Estado\tHumedad (%)\tTemperatura (C)\t(F)\tIndice de Calor (C)\t(F)");
@mbenegas
mbenegas / rsync-retry.sh
Created November 7, 2017 03:16 — forked from iangreenleaf/rsync-retry.sh
rsync with retries
#!/bin/bash
### ABOUT
### Runs rsync, retrying on errors up to a maximum number of tries.
### Simply edit the rsync line in the script to whatever parameters you need.
# Trap interrupts and exit instead of continuing the loop
trap "echo Exited!; exit;" SIGINT SIGTERM
MAX_RETRIES=50
#!/bin/sh
set -e
set -x
mkdir temp
cd temp
wget http://download.microsoft.com/download/E/6/7/E675FFFC-2A6D-4AB0-B3EB-27C9F8C8F696/PowerPointViewer.exe
cabextract -L -F ppviewer.cab PowerPointViewer.exe
cabextract ppviewer.cab
@mbenegas
mbenegas / find.php
Last active April 21, 2016 20:19
Find value in multidimensional array.
<?php
function find($criteria, $array, &$match){
$found = array_key_exists($criteria, $array);
if ($found === false){
foreach ($array as $value){
if (is_array($value)){
if (!find($criteria, $value, $match)){
continue;
} else {
@mbenegas
mbenegas / ensite.sh
Created September 22, 2012 17:59 — forked from mateusg/ensite.sh
Script for enabling a site, just like a2ensite, from Apache2.
#! bin/bash
# Enables a site, just like a2ensite command, from Apache2.
SITES_AVAILABLE_CONFIG_DIR="/opt/nginx/sites-available";
SITES_ENABLED_CONFIG_DIR="/opt/nginx/sites-enabled";
if [ $1 ]; then
if [ -f "${SITES_ENABLED_CONFIG_DIR}/${1}" ]; then
echo "Site ${1} was already enabled!";
elif [ ! -w $SITES_ENABLED_CONFIG_DIR ]; then
@mbenegas
mbenegas / gist:3140859
Created July 19, 2012 05:03
Pad resize to fit
{
"application_id":"APP-ID",
"src":"http://www.google.com/logos/2011/houdini11-hp.jpg",
"functions":[
{
"name":"trim",
"functions":[
{
"name":"watermark",
"params":{
@mbenegas
mbenegas / gist:3139481
Created July 18, 2012 22:46 — forked from blitline-dev/gist:3137772
Trim, Watermark, Resize to fit
{
"application_id": "APP-ID",
"src" : "http://www.google.com/logos/2011/houdini11-hp.jpg",
"functions" :
[
{
"name" : "trim",
"functions" : [
{
"name": "watermark",