Skip to content

Instantly share code, notes, and snippets.

@pierrelorioux
pierrelorioux / chart.js
Created November 24, 2015 09:19 — forked from chrtze/chart.js
Line Chart Example
var Chart = (function(window,d3) {
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height, locator;
var breakPoint = 768;
d3.csv('data.csv', init); //load data, then initialize chart
//called once the data is loaded
function init(csv) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pierrelorioux
pierrelorioux / README.md
Last active September 12, 2015 21:42 — forked from dowstreet/README.md
Connected Particles III
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION:
Notes for deploying TileStream on an AWS EC2 Ubuntu 12.04.2 Server for development. Includes workflow for creating
a local tile cache with TileMill, connecting to your Ubuntu EC2 server via SSH using Mac OSX Terminal, and uploading
your tiles (.mbtiles) to your TileStream server.
REFERENCES:
TileStream git repo: https://github.com/mapbox/tilestream
-----------------------------------------------------------------------------------------------------------------------------
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#Autors : E.DELAY (GEOLAB, université de Limoges (FR))and F.Zottele (Fondazion E.Mach (IT))
#Script merge data from twitteR script and map it with hexagon cell for couned twittes
rm(list=ls())
setwd("~/git/datablogvinometro/twitteR/data/csv/")
# dataToMap<-read.csv("dataToMap.csv", head=T)
reqURL = "https://api.twitter.com/oauth/request_token"
accessURL = "http://api.twitter.com/oauth/access_token"
authURL = "http://api.twitter.com/oauth/authorize"
consumerKey = "nP9JdRBlToVZ4xXrNeUbw"
consumerSecret = "KsK7qsu13cEUXhlpUSSo4UGHsoSTuBvwVPqzKAb6DqU"
library(twitteR)
twitCred = OAuthFactory$new(consumerKey=consumerKey,consumerSecret=consumerSecret,requestURL=reqURL,accessURL=accessURL,authURL=authURL)
twitCred$handshake()
save(twitCred, file="../cred.RData")
#Autors F.Zottele (Fondazion E.Mach (IT)) and E.DELAY (GEOLAB, université de Limoges (FR))
#Script for download 45 twittes with twitter API for dev
rm(list=ls())
setwd("~/git/datablogvinometro/twitteR/data/")
library(twitteR)
library(lubridate)
// the location we want to GeoCode
var location = 'London';
// we are using MapQuest's Nominatim service
var geocode = 'http://open.mapquestapi.com/search?format=json&q=' + location;
// use jQuery to call the API and get the JSON results
$.getJSON(geocode, function(data) {
// get lat + lon from first match
var latlng = [data[0].lat, data[0].lon]]