Skip to content

Instantly share code, notes, and snippets.

View joshuarrrr's full-sized avatar

Josh Romero joshuarrrr

View GitHub Profile
@joshuarrrr
joshuarrrr / example_strategy.js
Last active August 22, 2018 22:39 — forked from emmettbutler/example_strategy.js
An example script demonstrating how to track custom video players with Parse.ly's JavaScript API
var platform = "myVideoPlatform";
var strategy = {
platform: platform,
searchTags: ["DIV"],
verify: function(elem) {
return (' ' + elem.className + ' ').indexOf(" my_video ") !== -1;
},
subscribe: function(elem) {
var playerApi = myVideoJsApi(elem);
playerApi.on("play", function(playedVideoMetadata) {
var mainTextStyles = [
"color: #fff",
"background: #5ba745",
"font-weight: bold",
"display: block",
].join(";")
var errorStyles = [
"color: #fff",
"background: #D05C4D",
"font-weight: bold",
@joshuarrrr
joshuarrrr / gist:8d1be97a16cbb2e865b3b0a0d70ac55a
Created April 4, 2016 17:16 — forked from alykat/gist:5fabb42475a6111ccc38591bac09550a
D3: Wrap label text and make SVG taller
/*
* Wrap a block of text to a given width
* via http://bl.ocks.org/mbostock/7555321
*/
var wrapText = function(texts, width, lineHeight) {
texts.each(function() {
var text = d3.select(this);
var words = text.text().split(/\s+/).reverse();
var word = null;
@joshuarrrr
joshuarrrr / index.html
Last active August 29, 2015 14:20 — forked from mbostock/.block
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.27.2"></script>
<style type="text/css">
path {
fill: none;
stroke: #000;
stroke-width: 7px;
@joshuarrrr
joshuarrrr / counter.rb
Last active August 29, 2015 14:14 — forked from luigi/counter.rb
#
# Before running:
# $ gem install twitter
#
# Register a Twitter application to get auth credentials:
# https://dev.twitter.com/apps
#
# To run:
# $ ruby counter.rb upworthy.com 500
#