Skip to content

Instantly share code, notes, and snippets.

@joshorvis
joshorvis / datefilter.js
Last active August 29, 2015 13:58 — forked from Voles/datefilter.js
app.filter('daterange', function () {
return function(items, date_field,start_date, end_date) {
var result = [];
// date filters
var start_date = (start_date && !isNaN(Date.parse(start_date))) ? Date.parse(start_date) : 0;
var end_date = (end_date && !isNaN(Date.parse(end_date))) ? Date.parse(end_date) : new Date().getTime();
// if the items are loaded
if (items && items.length > 0) {
<!--
www.mycompany.com - Normal website appears
www.mycompany.com?vidyard=true - Website appears, Vidyard player launched in lightbox
-->
<html>
<head>
<!-- Parsing the query string. Sample taken from http://javascript.about.com/library/blqs.htm -->
<script type="text/javascript">
var qsParm = new Array();
function qs() {
<html>
<head>
<style type="text/css">
.video_container {
position: relative;
/* Set max values to player size */
max-width: 640px;
max-height: 360px;
display:block;
}
<html>
<head>
</head>
<body>
<!-- By default, the pop-out CTA is 300px wide. You might want to set the div width and height to allow for a border -->
<div style="width:260px; height:250px;">
<!-- Sample HTML form. Can be replaced with a form from your favourite MAP (e.g. Hubspot, Silver Pop, etc.) -->
<form>
<table>
<tr>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
function getEmbedCode(uuid) {
var script=document.createElement('script');
script.type='text/javascript';
script.id='vidyard_embed_code_'+uuid;
script.src='https://play.vidyard.com/'+uuid+'.js?v=3.1&type=inline';
return script;
<htmL>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
function getEmbedCode(uuid) {
var script=document.createElement('script');
script.type='text/javascript';
script.id='vidyard_embed_code_'+uuid;
script.src='https://play.vidyard.com/'+uuid+'.js?v=3.1&type=inline';
return script;
<html>
<head></head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type='text/javascript'>
window.onload=function() {
$("#video_container").html('<script type="text/javascript" id="vidyard_embed_code_oTDMPlUv--51Th455G5u7Q" src="//play.vidyard.com/oTDMPlUv--51Th455G5u7Q.js?v=3.1&type=inline"><\/script>');
};
</script>
<div id='video_container'>
<html>
<head>
<!-- Vidyard player API script -->
<script src="//play.vidyard.com/v0/api.js"></script>
<!-- Google Analytics tracking code -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);
/**
*
* @author Gabriel Alonso <gbr.alonso@gmail.com>
*
* Angular Modal Service
*
* Requiere Bootstrap's modal (http://getbootstrap.com/javascript/#modals)
*
* Example:
*
@joshorvis
joshorvis / inc_id_rules.js
Last active August 29, 2015 14:27 — forked from katowulf/inc_id_rules.js
Security rules for creating an incremental, numeric ID in Firebase
{
"rules": {
".read": true,
".write": false,
"incid": {
"counter": {
// this counter is set using a transaction and can only be incremented by 1
// the total number of records must be less than 10,000 simply for demo purposes
".write": "newData.isNumber() && ((!data.exists() && newData.val() === 1) || newData.val() === data.val()+1) && newData.val() <= 10000"
},