This file contains hidden or 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
function getYoutubeKey(linkText) { | |
// var linkText = $('#modal #vidEmbedKey').val(); | |
var reYoutubeKey = /^[a-zA-Z0-9\-]{11}$/; | |
if (reYoutubeKey.test(linkText)) { | |
return linkText; | |
} | |
var reYoutubeUrl = /http\:\/\/www\.youtube\.com\/watch\?v=([\w-]{11})/; | |
var httpsreYoutubeUrl = /https\:\/\/www\.youtube\.com\/watch\?v=([\w-]{11})/; |
This file contains hidden or 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
String.prototype.format = function () { | |
var re = /\{\d+\}/g, args = arguments; | |
return this.replace(re, function (x) {return args[x.match(/\d+/)]; }); | |
}; | |
// Number.toRad method | |
if (typeof(Number.prototype.toRad) === "undefined") { | |
Number.prototype.toRad = function() { | |
return this * Math.PI / 180; | |
} |
This file contains hidden or 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
// parse a string input or text body for # | |
// | |
function parseHashTags(words) { | |
var str_array = words.split(" "); | |
var pattern = /^\#/gi; | |
// the specific str_array element being processed | |
var part = ""; | |
// rebuilt string of original title with hyperlinked words |
This file contains hidden or 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
// handle the facebook api watch functions for the youtube player | |
// removes the posted watch if it does not meet the requirements | |
var ytPlayerInterval, ytplayer; | |
function handleAPIWatch(){ | |
try { | |
($('#modal_content object embed')[0]) ? ytplayer = $('#modal_content object embed')[0] : ytplayer = ""; | |
var time = ytplayer.getCurrentTime(); | |
if(ytplayer.getCurrentTime() >= (ytplayer.getDuration() / 2)) { | |
// console.log("out after 50"); | |
if (fbstart) { |
This file contains hidden or 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
var validatePrice = /((\d+\.|\.)[0-9]{1,2})|\d+/; | |
if (!validatePrice.test($('#marketPrice').val())) { | |
alert_error('your price must be a numeric value'); | |
return false; | |
} |
This file contains hidden or 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
$(function () { | |
// generated timestamps | |
t = ['1/1/2010 00:00', '1/1/2010 01:00','1/2/2010 23:00']; // (hourly data for two days) | |
// generated values | |
vals = [34, 15, 28, 16, 8, 47, 35, 41, 1, 24, 13, 19, 18, 27, 32, 6, 39, 25, 9, 14, 22, 40, 38, 48, 36, 12, 3, 31, 43, 29, 42, 2, 21, 23, 11, 44, 30, 10, 49, 33, 17, 37, 7, 4, 45, 46, 50, 5, 26, 20]; // random list of values - two days in length | |
// declaring model | |
var graphVals = new Backbone.Model({time: t, value: vals}); |
This file contains hidden or 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
i = setInterval(function() {e = $(".down")[0]; if(e) e.onclick(); else clearInterval(i);}, 500); |
This file contains hidden or 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
{ | |
"name": "flare", | |
"children": [ | |
{ | |
"name": "analytics", | |
"children": [ | |
{ | |
"name": "cluster", | |
"children": [ | |
{"name": "AgglomerativeCluster", "size": 3938}, |
This file contains hidden or 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
_scrollContainer: -> | |
targets = d3.select(d3.selectAll('g.node.selection').pop()).node() | |
return unless targets | |
selectionCoord = targets.pop().getBoundingClientRect() | |
selectedTarget = d3.select('g.selected') | |
selectedTarget = _.compact selectedTarget[0] | |
return unless selectedTarget.length > 0 | |
selectedCoord = selectedTarget[0].getBoundingClientRect() | |
bottomCoord = Math.max selectionCoord.bottom, selectedCoord.bottom |
This file contains hidden or 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
_transformFeedData: (feed) -> | |
processedFeed = {} | |
intervalWindow = [] | |
timeStep = {} | |
metaCounter = 1 | |
timeStep = @_getTimeStep feed[0].time, feed[1].time | |
initialDate = new Date(feed[0].time).getTime() | |
metaCounter = @_getMetaCount initialDate, timeStep |
OlderNewer