Skip to content

Instantly share code, notes, and snippets.

Louis Chatriot louischatriot

Block or report user

Report or block louischatriot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@louischatriot
louischatriot / gist:2601571
Created May 5, 2012
d3 introduction: animated graph in 11 LOC
View gist:2601571
<!DOCTYPE html>
<html manifest="cache.manifest">
<head> <title>d3 example</title> </head>
<body>
<div id='d3TutoGraphContainer'></div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
@louischatriot
louischatriot / chart.js
Created May 5, 2012
d3 introduction code - js part
View chart.js
// Suppose there is currently one div with id "d3TutoGraphContainer" in the DOM
// We append a 600x300 empty SVG container in the div
var chart = d3.select("#d3TutoGraphContainer").append("svg").attr("width", "600").attr("height", "300");
// Create the bar chart which consists of ten SVG rectangles, one for each piece of data
var rects = chart.selectAll('rect').data([1 ,4, 5, 6, 24, 8, 12, 1, 1, 20])
.enter().append('rect')
.attr("stroke", "none").attr("fill", "rgb(7, 130, 180)")
.attr("x", 0)
.attr("y", function(d, i) { return 25 * i; } )
@louischatriot
louischatriot / nodejs-app.conf
Created Aug 18, 2012
Upstart script to launch a nodejs application as a service
View nodejs-app.conf
description "Upstart script to run a nodejs app as a service"
author "Louis Chatriot"
env NODE_BIN=/usr/local/bin/node
env APP_DIR=/path/to/app/dir
env SCRIPT_FILE="scriptfile.js" # Entry point for the nodejs app
env LOG_FILE=/path/to/logfile.log
env RUN_AS="anyuser" # Upstart can only be run nicely as root, need to drop privileges
env SERVER_ENV="anything" # Usual apps can be run in different environments (development, test, production ...)
# I typically use the environment variable NODE_ENV (see below)
@louischatriot
louischatriot / gist:5698805
Last active Jun 27, 2018
Trying to use the VLC plugin work in windowless mode on linux. This HTML file is the windowless example from the Git repo for the plugin (git://git.videolan.org/npapi-vlc.git). I just added one line (L238) that tries to draw a red square on top of the player, but it is behind ...
View gist:5698805
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<title>VLC Plugin test page</TITLE>
<style>
.inputTrackerInput {
height:20;
width:30;
font-family : Arial, Helvetica, sans-serif;
font-size : 12px;
}
@louischatriot
louischatriot / bugreport.js
Last active Sep 18, 2015
Example of a good bug report for NeDB
View bugreport.js
// Put all your require statements at the top. Your gist should contain a package.json which lets me download all
// the dependencies needed to test your bug report with a simple 'npm install'
var async = require('async')
, someOtherModule = require('xxx')
, fs = require('fs');
// Then require nedb and chai. You need to use chai for your assertions
var Nedb = require('nedb')
, chai = require('chai')
, assert = chai.assert; // Chai supports assert and should style of assertion
You can’t perform that action at this time.