Skip to content

Instantly share code, notes, and snippets.

View next-marianmoldovan's full-sized avatar

Marian C Moldovan next-marianmoldovan

  • BBVA Next Technologies
  • Madrid
View GitHub Profile
#clean encoding
iconv -f iso-8859-1 -t utf-8 -c items.json > clean.json
#import objets in mongo
mongoimport --db books --collection books --file clean.json
@next-marianmoldovan
next-marianmoldovan / MotionControls.js
Created January 8, 2015 11:12
THREE VR Controller for mobiles with MotionControls from jbouny
/**
* @author jbouny / http://github.com/jbouny
*/
// This control perform rotation on one object by using gyroscope data.
// It only works on devices and browsers providing the deviceorientation event (smartphones, tablets).
// It permits to control the 3D camera with a natural way, by moving the device around oneself.
// One application can be augmented reality.
THREE.MotionControls = function ( object3D ) {
@next-marianmoldovan
next-marianmoldovan / DeviceOrientationControls.js
Created January 8, 2015 11:15
THREE VR Controller for mobiles with DeviceOrientationControls
/**
* @author richt / http://richt.me
* @author WestLangley / http://github.com/WestLangley
*
* W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)
*/
THREE.DeviceOrientationControls = function ( object, controls ) {
var scope = this;
@next-marianmoldovan
next-marianmoldovan / Safe.ino
Created February 3, 2015 16:46
Safe, leds, speaker, sound sensor, ldr and temp/hum sensor
#include <Firmata.h>
#include <Boards.h>
#include <math.h>
#include <DHT.h>
#define RED 12
#define GREEN 13
#define SOUND_SENSOR A4
#define LIGHT_SENSOR 0
@next-marianmoldovan
next-marianmoldovan / monitor.ino
Created February 4, 2015 11:24
Office monitor
#include <LedControl.h>
#include <AirQuality.h>
#include <Arduino.h>
#include <Firmata.h>
#include <Boards.h>
#include <math.h>
#include <DHT.h>
@next-marianmoldovan
next-marianmoldovan / pipelines.py
Last active December 3, 2022 12:42
JSON UTF-8 Pipeline Scrapy
import json, io, codecs, os
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
class BeevaPipeline(object):
def __init__(self):
dispatcher.connect(self.spider_opened, signals.spider_opened)
dispatcher.connect(self.spider_closed, signals.spider_closed)
@next-marianmoldovan
next-marianmoldovan / gist:e0e2029a04d4829a6501
Created March 26, 2015 15:15
Clean other files that are not images bash script
file * | grep -v image > noimage
cat noimage | cut -d : -f 1 | noimageids
rm -f $(<noimageids)
rm noimageids
{ message: 'new_face',
faceId: '64530daa-c3e8-4d71-8fd5-d36f0703d75d' }
{ message: 'new_face_snap',
faceId: '64530daa-c3e8-4d71-8fd5-d36f0703d75d' }
{ message: 'known_face',
confidence: '0.928526043891907',
faceId: '64530daa-c3e8-4d71-8fd5-d36f0703d75d' }
{ message: 'known_face',
confidence: '0.938279509544373',
faceId: '64530daa-c3e8-4d71-8fd5-d36f0703d75d' }
var th = require("telehash");
function startMesh(keys){
th.mesh({id:keys}, function(err, mesh){
if(err) return console.log("mesh failed to initialize",err);
// use mesh.* now
console.log(mesh.uri());
});
}