Skip to content

Instantly share code, notes, and snippets.

@chrisirhc
chrisirhc / sasswatch.js
Created January 21, 2014 05:53
Watch sass files with awareness of the dependency graph (so that files that don't need to be recompiled don't get recompiled).
module.exports = function (grunt) {
var fs = require('fs');
grunt.registerTask('sasswatch', 'Watch Sass with awareness of dependency graph', function () {
var options = this.options({
sassPath: 'sass',
logFile: null,
style: 'nested',
@chrisirhc
chrisirhc / customshapes.js
Last active December 24, 2015 18:09
shapeText Example 6
/* globals d3, angular */
angular.module('myCustomShapes', ['myMod'])
.directive('myTriangle', function () {
var line = d3.svg.line()
.x(function(d) { return d.x; })
.y(function(d) { return d.y; });
return {
restrict: 'E',
@chrisirhc
chrisirhc / README.md
Last active June 2, 2016 14:33
Example of using AngularJS to render text into SVG shapes

Example of using AngularJS to render text into SVG shapes

Makes use of directive controllers to customize behavior per shape.

@chrisirhc
chrisirhc / README.md
Last active December 19, 2015 02:29

Case 3

Read about this and more on the ThousandEyes blog.

@chrisirhc
chrisirhc / README.md
Last active December 17, 2015 15:19
Example 1
@chrisirhc
chrisirhc / README.md
Last active December 17, 2015 03:29
Self-redirecting page

Example 3 (Anti-pattern)

Self-redirecting page

Please don't do this!

A self-redirect initiated by the JavaScript to a page can make it very difficult to write a test for that page.

The test script is unable to determine whether the page has completed the

@chrisirhc
chrisirhc / README.md
Last active December 17, 2015 03:28
Dynamic IFRAME generation

Example 2 (Anti-pattern)

Dynamically generated IFRAMEs

Please don't do this!

Dynamically generated IFRAMEs can complicate testing for the page.

Goal

@chrisirhc
chrisirhc / README.md
Last active December 17, 2015 03:18
Timeout with targetable DOM feedback
@chrisirhc
chrisirhc / README.md
Last active December 17, 2015 03:09
Timeout with no targetable DOM feedback

Case 2

Read about this and more on the ThousandEyes blog.