This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; } ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |