A D3 line chart demonstrating d3.svg.brush()
for zooming capabilities à la Google Finance
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
'use strict'; | |
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet; | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' | |
// use this if you want to match all subfolders: |
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
func main() { | |
watchers, pager, _, err := client.Activity.ListWatchers("o", "r") | |
if pager.HasNext() { | |
watchers, pager, _, err = pager.Next() | |
} | |
//.. | |
//or: | |
watchers, pager, _, err = pager.Last() | |
} |
A simple gauge chart using d3 Inspired by Jake Trent's Codepen snippet
To move the pointer needle, type in following code in you javascript console
needle.moveTo(.25)
Yet another simple gauge chart using d3 Inspired by Jake Trent's Codepen snippet
To move the pointer needle, type in following code in you javascript console
needle.moveTo(.25)
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
angular.module('myApp').controller( function ( $scope ) { | |
var foo = $('button.foo'), | |
bar = $('input[data-role="bar"]'), | |
baz = $('div.status'), | |
flag = true; | |
foo.click( function () { | |
if ( flag ) { | |
bar.hide(); | |
baz.addClass( 'done' ); | |
} |
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
angular.module( 'ameyms.jqplugin' ). | |
directive( 'applyPlugin', [ 'jqueryPlugins', function ( jqPlugins ) { | |
var postLinkFn; | |
postLinkFn = function ( scope, elem, attrs ) { | |
var currPlugin = attrs.applyPlugin, | |
opts = jqueryPlugins.getOptionsFor( currPlugin ); | |
// Apply plugin | |
$( elem )[ currPlugin ]( opts ); |
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
// Word cloud layout by Jason Davies, http://www.jasondavies.com/word-cloud/ | |
// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf | |
(function() { | |
function cloud() { | |
var size = [256, 256], | |
text = cloudText, | |
font = cloudFont, | |
fontSize = cloudFontSize, | |
fontStyle = cloudFontNormal, | |
fontWeight = cloudFontNormal, |
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
/* | |
Ratings Stars | |
(with as little code as possible) | |
*/ | |
.rating { | |
unicode-bidi: bidi-override; | |
direction: rtl; | |
text-align: center; | |
} | |
.rating > span { |
OlderNewer