Skip to content

Instantly share code, notes, and snippets.

Example of a D3js time series graph with X,Y crosshairs and a threshold line. Just copy the drawLineGraph function and call it with your data. The data shoud be an array of two element arrays. Something like:

var data = [
    [new Date(2014, 01, 10), 404],
    [new Date(2014, 01, 11), 123],
    [new Date(2014, 01, 12), 666]
    ];
    
var warnLine = { lineValue: 200, label: 'my important threshold' };
// https://raw.githubusercontent.com/eligrey/FileSaver.js/master/FileSaver.js
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 2014-08-29
*
* By Eli Grey, http://eligrey.com
* License: X11/MIT
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
*/
@lamchau
lamchau / Soda Dark.sublime-theme
Last active August 29, 2015 14:06
Sublime Text 3: Soda Dark Theme tweaks
[
// remove ST3 3065 file/folder icons
{
"class": "icon_file_type",
"content_margin": [0, 0]
}, {
"class": "icon_folder",
"content_margin": [0, 0]
}, {
"class": "icon_folder_loading",
@lamchau
lamchau / github-pr-cleaner.js
Last active August 29, 2015 14:06
Commit comment deletion bookmarklet for Pull Requests on GitHub. Written to clean up spammy build-bot. Minify for use with http://closure-compiler.appspot.com/home
(function() {
var author = "displayName";
var clickElement = function(element) {
if (!!!element) {
return;
}
var event = document.createEvent("HTMLEvents");
event.initEvent("click", true, true);
event.eventName = "click";
element.dispatchEvent(event);
@lamchau
lamchau / .gitignore
Last active August 29, 2015 14:07 — forked from GerHobbelt/.gitignore
# Editor backup files
*.bak
*~
@lamchau
lamchau / .gitignore
Last active August 29, 2015 14:07 — forked from GerHobbelt/.gitignore
# Editor backup files
*.bak
*~
using System;
namespace ConsoleApplication
{
enum Suit
{
DIAMOND,
CLUB,
HEART,
SPADE
@lamchau
lamchau / README.md
Last active August 29, 2015 14:07 — forked from milroc/README.md
[
// highlight modified files (orange for dirty files, like default theme)
{
"class": "tab_label",
"settings": ["highlight_modified_tabs"],
"parents": [{
"class": "tab_control",
"attributes": ["dirty"]
}],
// "fg": [120, 170, 250], // blue
[
// highlight modified files (blue for dirty files, like default theme)
{
"class": "tab_label",
"settings": ["highlight_modified_tabs"],
"parents": [{
"class": "tab_control",
"attributes": ["dirty"]
}],
"fg": [20, 100, 220]