Skip to content

Instantly share code, notes, and snippets.

View lvidarte's full-sized avatar

Leo Vidarte lvidarte

View GitHub Profile
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/nonfree/features2d.hpp>
using namespace cv;
using namespace std;
#include <LiquidCrystal.h>
// Todo lo que empieza con doble / es un comentario, no necesitás copiarlo.
// Inicializar la librería con los pines usados en el LCD:
// (RS, Enable, DB4, DB5, DB6, DB7)
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup()
{
package main
import "fmt"
import "os"
func main() {
defer func() {
str := recover()
fmt.Println(str)
}()
package main
import "fmt"
func first() {
fmt.Println("1st")
}
func second() {
fmt.Println("2nd")
}
package main
import "fmt"
func main() {
f()
fmt.Println("Returned normally from f.")
}
func f() {
api:
image: counter_app
container_name: 'counter'
ports:
- "3000:3000"
volumes:
- ./:/app
links:
- redis:counter_db
redis:
@lvidarte
lvidarte / Dockerfile
Last active August 29, 2015 14:27
Dockerfile with node app example
FROM node:0.12
RUN npm install -g nodemon
ADD start.sh /bin/start
WORKDIR /app
EXPOSE 3000
@lvidarte
lvidarte / server.js
Last active September 1, 2015 02:15
Simple nodejs server with redis connection
var http = require('http');
var redis = require('redis');
var client = redis.createClient(6379, 'app_db');
http.createServer(function (req, res) {
client.incr('counter', function (err, reply) {
console.log('Counter value', reply);
res.writeHead(200, {'Content-Type': 'application/json'});
res.end(JSON.stringify({ counter: reply }) + "\n");
});
@lvidarte
lvidarte / check_duplicates.py
Last active August 29, 2015 14:26
Chequeo de items duplicados en paginado
#!/usr/bin/python
import requests
import json
import math
import sys
LIMIT = 12
SITES = {
@lvidarte
lvidarte / lcd_dht.ino
Last active August 29, 2015 14:26
Arduino DHT21 Temperature & Humidity Sensor on LCD 2x16 display
#include <stdio.h>
#include <LiquidCrystal.h>
#include <DHT.h>
#define DHT_PIN 5
#define DHT_TYPE DHT21
#define LCD_LINE_LENGTH 17
// Initialize library with the numbers of the interface pins: