Skip to content

Instantly share code, notes, and snippets.

View xseignard's full-sized avatar
🦄
Internet thuggin'

Xavier Seignard xseignard

🦄
Internet thuggin'
View GitHub Profile
@xseignard
xseignard / plugin.xml
Created April 15, 2015 10:17
plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
id="fr.drangies.cordova.serial"
version="0.0.2">
<name>Serial</name>
<description>Cordova plugin to communicate with the android USB serial port</description>
<license>MIT</license>
<keywords>serial,arduino</keywords>
#include <SoftwareSerial.h>
// ESP8266 rx, tx
SoftwareSerial esp8266(11, 12);
void setup() {
//connection to ESP8266
esp8266.begin(9600);
esp8266.setTimeout(2000);
//serial debug
@xseignard
xseignard / gist:752e4ed266c6fbdb4543
Last active August 29, 2015 14:17
99-myrules.rules
KERNEL=="ttyUSB*", KERNELS=="2-1.3.6", SYMLINK+="printer1"
KERNEL=="ttyUSB*", KERNELS=="2-1.3.7", SYMLINK+="printer2"
KERNEL=="ttyUSB*", KERNELS=="2-1.3.1", SYMLINK+="printer3"
KERNEL=="ttyUSB*", KERNELS=="2-1.3.5", SYMLINK+="printer4"
KERNEL=="ttyUSB*", KERNELS=="2-1.3.4", SYMLINK+="printer5"
KERNEL=="ttyUSB*", KERNELS=="2-1.3.3", SYMLINK+="printer6"
KERNEL=="ttyUSB*", KERNELS=="2-1.3.2", SYMLINK+="printer7"
@xseignard
xseignard / trakt-auth.html
Last active August 29, 2015 14:16
polymer
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<polymer-element name="trakt-auth" attributes="">
<template>
<link rel="stylesheet" href="trakt-auth.css">
<core-ajax
url="http://gdata.youtube.com/feeds/api/videos/"
> [email protected] postinstall /home/bas/app_74a3d74d-f5fb-4634-8c1d-48ab1dd6c72b/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin
2015-01-30T14:19:36.045+01:00> node lib/install.js
2015-01-30T14:19:38.538+01:00✔ optipng pre-build test passed successfully
2015-01-30T14:19:38.544+01:00> [email protected] postinstall /home/bas/app_74a3d74d-f5fb-4634-8c1d-48ab1dd6c72b/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin
2015-01-30T14:19:38.544+01:00> node lib/install.js
2015-01-30T14:19:40.284+01:00⚠ The `pngquant` binary doesn't seem to work correctly
2015-01-30T14:19:40.285+01:00⚠ pngquant pre-build test failed
2015-01-30T14:19:40.285+01:00ℹ compiling from source
2015-01-30T14:19:46.376+01:00✔ pngquant built successfully
2015-01-30T14:19:46.381+01:00> [email protected] postinstall /home/bas/app_74a3d74d-f5fb-4634-8c1d-48ab1dd6c72b/node_modules/grunt-contrib-imagemin/node_modules/imag
@xseignard
xseignard / test.js
Last active August 29, 2015 14:14
cadeau!
var data = {
_id: "fridge",
values: [
{
hourAgo: 0,
value: 10
},
{
hourAgo: 2,
value: 12
@xseignard
xseignard / aggregateHelper.js
Created January 26, 2015 16:37
aggregationCroustillante.js
// function to aggregate values of the last 24h of a given sensor, according to its strategy
var last24 = function(sensorConf, callback) {
// get current hour in order to make some relative calculations
var current = moment();
var currentHour = current.utc().hour();
// get yesterday date (from h-23 to h+1 to get the running hour, e.g. from 2h yesterday to 2h today when it's 1h)
var yesterday = current.startOf('hour').add(1, 'h').subtract(24, 'h').toDate();
var aggregate = Event.aggregate();
if (sensorConf) {
Target URL: https://sidlee.herokuapp.com
Max requests: 500
Concurrency level: 50
Agent: none
Requests per second: 10
Completed requests: 500
Total errors: 0
Total time: 46.354558287 s
Requests per second: 11
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2561_U.h>
#include <Ethernet.h>
#include <SPI.h>
#include <elapsedMillis.h>
#define PIN_TEMP 0
#define PIN_DB 2
@xseignard
xseignard / googleAnalytics.js
Created January 19, 2015 18:59
Node.js + googleapis to query google analytics
var googleapis = require('googleapis'),
JWT = googleapis.auth.JWT,
analytics = googleapis.analytics('v3');
var SERVICE_ACCOUNT_EMAIL = '[email protected]';
var SERVICE_ACCOUNT_KEY_FILE = __dirname + '/key.pem';
var authClient = new JWT(
SERVICE_ACCOUNT_EMAIL,