Skip to content

Instantly share code, notes, and snippets.

@tommyh
tommyh / hls_startfromlevel_0.html
Last active August 29, 2015 14:26
flashls: hsl_startfromlevel=0 confusion
<!DOCTYPE html>
<html>
<head>
<title>Video.js | HTML5 Video Player</title>
<link href="http://www.flashls.org/videojs/video-js.css" rel="stylesheet" type="text/css">
<script src="http://www.flashls.org/videojs/video.js"></script>
<script>
videojs.options.flash.swf = "http://tout-development.site.s3.amazonaws.com/tomhallettest/video-js-mangui-dist.swf";
videojs.options.flash.flashVars = { hls_startfromlevel: 0 };
</script>
@tommyh
tommyh / gist:1549606
Created January 2, 2012 06:37
OSX Lion - Machine Bootstrap (rails, mysql, rvm, rubymine, etc)
# Prereqs
# os x (i have lion)
# install Xcode from the "App Store"
#install soloist gem
sudo gem install soloist --no-ri --no-rdoc
#create a dir to store your soloist cookbooks
mkdir -p ~/projects && cd ~/projects
mkdir -p chef/cookbooks/pivotal_workstation && cd chef/cookbooks/pivotal_workstation
@tommyh
tommyh / hired_dot_com_hide_salary_information.js
Created October 9, 2015 17:43
Hired.com: Hide Salary Information Bookmarklet
(function(){
var salaryElementSelector = ".salary, .subheading__salary, .offer-text, .candidate-info--salary, .btn-one-click-offer span",
salaryElements = document.querySelectorAll(salaryElementSelector);
for (var i = 0; i < salaryElements.length; ++i) {
salaryElements[i].style.display = "none";
}
})();
/*
Copyright (c) 2008-2015 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@tommyh
tommyh / README.md
Last active November 5, 2015 22:30
Tout: Wordpress Fix

Tout: Wordpress fix

Some wordpress themes have css styles which modify the height attribute for video players, resulting in a player element which has a small height and is broken. These css styles will fix those issues.

<h1>IAS: Pixel Tracking Debuger</h1>
<p>This page provides a bookmarklet to help debug the IAS tracking pixels.</p>
<h3>Usage</h3>
<ol>
<li>Install the bookmarklet by dragging the link below into your bookmarks bar</li>
<li>Go to a page which has a video player on it where IAS verification is in use</li>
<li>Click the bookmarklet</li>
<li>You should see 9 red squares appear - these are the IAS tracking pixels</li>
<li>You might see a the video player get a white halo around it. This will happen when the bookmarklet finds a script tag with the source of http://pixel.adsafeprotected.com/jload, and then it puts a border around the scripts parentNode.</li>
<!DOCTYPE>
<html>
<body>
<h1>Gardner Meerkat Bookmarklet</h1>
<a href="javascript:(function()%7B(function()%7Bvar%20css%20%3D%20'iframe%23mkEmbedPlayer-gardner%20%7B%20width%3A%20465px%20!important%3B%20height%3A%20465px%20!important%3B%20%7D'%2Chead%20%3D%20document.head%20%7C%7C%20document.getElementsByTagName('head')%5B0%5D%2Cstyle%20%3D%20document.createElement('style')%3Bstyle.type%20%3D%20'text%2Fcss'%3Bif%20(style.styleSheet)%7Bstyle.styleSheet.cssText%20%3D%20css%3B%7D%20else%20%7Bstyle.appendChild(document.createTextNode(css))%3B%7Dhead.appendChild(style)%3Bvar%20wrapper%20%3D%20document.createElement(%22div%22)%3Bwrapper.id%20%3D%20%22meerkat-wrapper%22%3Bwrapper.style.position%20%3D%20%22fixed%22%3Bwrapper.style.bottom%20%3D%20%220%22%3Bwrapper.style.right%20%3D%20%220%22%3Bvar%20script%20%3D%20document.createElement(%22script%22)%3Bscript.src%20%3D%20%22http%3A%2F%2Fmeerkatapp.co%2Fwidgets%2Fembed.js%22%3Bscript.className%20%3D%20%22mkEmbedPlayer%22%3Bscript.setAttribute(%22data-mute%22%
@tommyh
tommyh / gist:db777fddbdc5040b8dc3
Last active December 22, 2015 01:30
onGlobalDefined
var onGlobalDefined = function(func, varName){
if(typeof window[varName] !== "undefined"){
console.log("running");
func();
} else {
console.log("waiting");
setTimeout(function(){
onGlobalDefined(func, varName);
}, 10);
}
@tommyh
tommyh / gist:6706987
Last active December 23, 2015 22:59
This is a workaround for intermittent timing issues with the capybara/poltergeist/phantomjs stack. Approach: have each iframe phone home to the parent page on dom ready. In capybara, you can use this knowledge that the iframe has fully loaded before you attempt to use "within_frame" for the iframe.
# app/views/layouts/application.haml
= render "shared/test_iframe_loaded"
# app/views/shared/_test_iframe_loaded.haml
- if Rails.env.test?
:javascript
(function(){
if(window.top !== window.self){
$(document).ready(function(){
window.JasmineReact = {};
JasmineReact.renderComponent = function(component, container){
var done = false,
callback = function(){ done = true; },
isDone = function(){ return done; };
if(typeof container === "undefined" ){
container = document.getElementById("jasmine_content");
}