Skip to content

Instantly share code, notes, and snippets.

View 4rzael's full-sized avatar

4rzael 4rzael

  • Bordeaux, France
View GitHub Profile
@4rzael
4rzael / sim908.md
Last active December 28, 2016 00:49
Use the SIM908 on odroidC1

How to use the SIM908 on an ODROID-C1

Automatic way :

  • Download the file sim908.sh

  • type sh sim908.sh in your terminal

Manual way :

@4rzael
4rzael / spi-errors
Last active December 19, 2015 23:43
node-spi errors
> [email protected] install /home/pi/mcp/node_modules/spi
> node-gyp rebuild
make: Entering directory '/home/pi/mcp/node_modules/spi/build'
CXX(target) Release/obj.target/_spi/src/spi_binding.o
In file included from ../src/spi_binding.cc:19:0:
../src/spi_binding.h:47:9: error: ‘FunctionCallbackInfo’ does not name a type
../src/spi_binding.h:47:9: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../src/spi_binding.h:47:9: error: expected ‘,’ or ‘...’ before ‘<’ token
../src/spi_binding.h:48:9: error: ‘FunctionCallbackInfo’ does not name a type
@4rzael
4rzael / mcp3002.js
Created October 15, 2015 09:23
A litlle example code to read data from a MCP3002 on a RPi using pi-spi
'use strict';
var SPI = require('pi-spi');
var spi = SPI.initialize("/dev/spidev0.0");
// Read value from a MCP3002 (http://ww1.microchip.com/downloads/en/DeviceDoc/21294C.pdf)
function readMCP(channel, callback) {
if (spi === undefined) return;
var mode = (8 + channel) << 4;
@4rzael
4rzael / client.js
Created December 7, 2015 21:49
The logging version of MQTT client.js
'use strict';
/**
* Module dependencies
*/
/*global setImmediate:true*/
var events = require('events'),
Store = require('./store'),
eos = require('end-of-stream'),
mqttPacket = require('mqtt-packet'),
Writable = require('readable-stream').Writable,
@4rzael
4rzael / .gitignore
Last active December 21, 2015 15:56
Rapport de stage chez Ants.
.~*#
*.old
@4rzael
4rzael / node.md
Last active March 23, 2016 18:12
Node.JS lightning talk

node

  • Node.JS, c'est quoi ?
    • execute du JS
    • Hors navigateur
    • même moteur que chrome : V8

v8

sudo mkdir /usr/lib/systemd/system/

sudo touch /usr/lib/systemd/system/babette.service

nano /usr/lib/systemd/system/babette.service

écris

[Service]
@4rzael
4rzael / .Tuto.md
Last active March 7, 2017 22:58
TileStache POC

Dataviz

## Intro

You've got a GIS dataset, you want to serve a map to visualize it ?

What we need

@4rzael
4rzael / main.md
Last active April 25, 2024 04:41
GIS with pySpark.
NOTE : Take a look at the comments below !

GIS with pySpark : A not-so-easy journey

Why would you do that ?

Today, many datas are geolocalised (meaning that they have a position in space). They're named GIS datas.

It's not rare that we need to do operations on those, such as aggregations, and there are many optimisations existing to do that.

@4rzael
4rzael / main.py
Last active December 4, 2016 22:06
your_math_problem
#!/usr/bin/env python2
from math import cos as f, radians as u, sin as k
def area(h,c):
return f(u(c))*k(u(c))*h/2
if __name__ == '__main__':
import sys
if (len(sys.argv) < 3):
print "usage : %s HYPOTHENUSE ANGLE_IN_DEGREES" % sys.argv[0]