Skip to content

Instantly share code, notes, and snippets.

@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: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 15:19
Example 1
@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 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 / 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 / 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 / html5-drag-directive.js
Created January 23, 2014 02:29
HTML5 draggable/drop AngularJS directives
.directive("teDragitem5", [
'$parse',
function ($parse) {
return {
link: function (scope, element, attr) {
var dragElement = element;
// Many other quirks in IE9. Not worth solving.
@chrisirhc
chrisirhc / timeseries.html
Last active August 29, 2015 13:56
How to do multiple transclusions right
<te-widget>
<te-widget-config>
<div class="te-dash-config-search ui-form">
<input class="te-dash-config-search-field"
type="text" ng-model="tempCfg.search" ng-change="testLimit = 10" />
</div>
</te-widget-config>
<te-widget-body>
<te-timeseries timeseries-config="widget.config" />