Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
@ThomasG77
ThomasG77 / index.html
Last active March 24, 2016 01:44
Réponse par l'absurbe à la notion de "plaque tournante" sur https://twitter.com/chdelporte/status/712756689364258816 suite aux attentats à Bruxelles
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<link rel="stylesheet" href="http://openlayers.org/en/master/css/ol.css" type="text/css">
<style>
#map {
background-color: #445c66;
height:600px;
}
@ThomasG77
ThomasG77 / index.html
Last active July 27, 2016 20:49
Proj4js conversion using Lambert 93 and the new proj4js API (v2.x)Open your JavaScript console to see the result
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>proj4js v2 example </title>
</head>
<body>
<script src="//cdnjs.cloudflare.com/ajax/libs/proj4js/2.2.2/proj4.js" type="text/javascript"></script>
@ThomasG77
ThomasG77 / readme.md
Created September 15, 2016 23:37
"FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory" running npm search

Syndrom: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

When?

Doing an npm search whatever, npm tries to make indexing works.

It returns the "syndrom" message and as I'm using NVM a path like below referencing how npm has been called.

...
@ThomasG77
ThomasG77 / LICENSE
Last active November 4, 2016 17:23
Tangram plaything with OSM2VectorTiles tiles
MIT License
Copyright (c) 2016 Thomas Gratier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ThomasG77
ThomasG77 / Readme.md
Last active January 6, 2017 00:13 — forked from timelyportfolio/Readme.md
vega for time series chart with shaded blocks

vega stocks spec forked to add shaded blocks

Often time series charts can be enhanced by shaded blocks to highlight events or periods as shown by this example which uses the R package xtsExtra. Vega specs already allow this functionality, and it is fairly easy to implement.

I added an events object to the JSON data array.

    {
      "name": "events",
      "values": [
        {"name":"Test1", "start":"Apr 2000", "end":"Mar 2003"},
@ThomasG77
ThomasG77 / README.md
Last active February 19, 2017 13:30
Correction for cluster example in my "Beginner's Guide OpenLayers 3" due to change in OpenLayers library itself
@ThomasG77
ThomasG77 / .block
Created March 3, 2017 23:20 — forked from veltman/.block
Scribble map
height: 600
hg clone https://bitbucket.org/tiax/bitbucket-issues-cli # Fork repo with support for Git on Bitbucket
cd bitbucket-issues-cli
hg patch ../patch-bitbucket-issues-cli-1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vue-i18next demo</title>
<script src="https://rawgit.com/i18next/i18next/master/i18next.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://rawgit.com/rse/vue-params/master/vue-params.js"></script>
<script src="https://rawgit.com/rse/vue-i18next/master/vue-i18next.js"></script>
</head>
  1. What is the relationship between Node.js and V8? Can Node work without V8?
  2. How come when you declare a global variable in any Node.js file it's not really global to all modules?
  3. When exporting the API of a Node module, why can we sometimes use exports and other times we have to use module.exports?
  4. Can we require local files without using relative paths?
  5. Can different versions of the same package be used in the same application?
  6. What is the Event Loop? Is it part of V8?
  7. What is the Call Stack? Is it part of V8?
  8. What is the difference between setImmediate and process.nextTick?
  9. How do you make an asynchronous function return a value?
  10. Can callbacks be used with promises or is it one way or the other?