Skip to content

Instantly share code, notes, and snippets.

View DaveVoyles's full-sized avatar

Dave Voyles DaveVoyles

View GitHub Profile
private setInfoboxContent (name: string, city: string, spec: string, bio: string, twitter: string, websiteUrl: string, img: string) : any
{
this.defaultInfobox.setHtmlContent(
'<div class="bio-container">' +
'<h1 id="firstHeading" class="firstHeading">' + name + '</h1>' +
'<h3>' + city + '</h3>' +
'<h3>' + spec + '</h3>' +
'<div id="bodyContent">' +
bio +
'</div> <!-- .bodyContent-->' +
@DaveVoyles
DaveVoyles / evangelistTemplate.js
Created February 16, 2016 13:13
evangelistTemplate
// Formats text for bio -- appears above each pin when selected
// Loops through content in "Locations" array and places it in bio
// RETURNS: A formatted string which is drawn to the screen
function formatBiography(name, city, spec, img, bio, twitter, websiteUrl) {
var html = [""];
// Loop through all args; if any are not defined, just set them to an empty string
for (var i = 0; i < arguments.length; i++) {
if (arguments[i] == null) {
arguments[i] = "";
@DaveVoyles
DaveVoyles / console.log short
Created October 15, 2015 00:58
Got tired of writing console.log everywhere
/**
* Got tired of writing console.log everywhere, so this is my shorthand function for it.
* @param {string} - sVal
* @returns {function} - console.log('sVal')
*/
var c = function c (sVal) {
return console.log(sVal);
};
Object.observe(current,
function (changes){
if (changes[1]!== undefined) {
console.log('Changes: ', changes[1].name );
console.log('Old Val: ', changes[1].oldValue);
}
}
);
@DaveVoyles
DaveVoyles / Night-Trap-Cam-Living-ROom
Created July 20, 2015 01:33
Camera layout for Night Trap
/* 4- Living-Room */
var camLivingRoom = {
// Augers enter from outside
c232241: 'https://medianighttrap.blob.core.windows.net/asset-e41e435d-1500-80c4-70ef-f1e52dbc471a/00232241.mp4?sv=2012-02-12&sr=c&si=02d08290-0b0a-4034-b9f0-d8db227c6f29&sig=yJ6xoJnnV6aoLc04XkASxWwL9UHxPkhKcME5%2FNO0zTY%3D&st=2015-07-19T02%3A19%3A28Z&se=2115-06-25T02%3A19%3A28Z'
// TRAP: Augers caught on bookshelf
, c271442: 'https://medianighttrap.blob.core.windows.net/asset-e41e435d-1500-80c4-bef1-f1e52dbc4d16/00271442.mp4?sv=2012-02-12&sr=c&si=42a81bac-2d95-4f80-8aac-626335a5e760&sig=MAHzyqHhfFPhszrB3JG9LRsJruwVoD892C8nXm61xeU%3D&st=2015-07-19T02%3A19%3A36Z&se=2115-06-25T02%3A19%3A36Z'
// Augers Escape
, c271641: 'https://medianighttrap.blob.core.windows.net/asset-0308435d-1500-80c4-58ba-f1e52dbc50eb/00271641.mp4?sv=2012-02-12&sr=c&si=7e282a7b-0092-4f12-a655-365244830884&sig=HiM5bOCTM6%2BAfBli1N642%2BcoB7cZ5uflwobMboFoofg%3D&st=2015-07-19T02%3A19%3A39Z&se=2115-06-25T02%3A19%3A39
@DaveVoyles
DaveVoyles / VideoTag
Created May 29, 2015 16:01
Video Tag for GetUserMedia
<div class="view--video">
<video id="videoTag" src="" autoplay muted class="view--video__video"></video>
</div>
@DaveVoyles
DaveVoyles / changeCssFilterOnVid
Created May 29, 2015 15:59
Change CSS filters on video
// changeCssFiltersOnVid() - Cycle through CSS filters applied to the video stream
// 1. Grab a reference to the video tag
// 2. Keep the original CSS classes while still adding the filters
// 3. Loop through all of the filters
var changeCssFilterOnVid = function () {
var el = document.getElementById('videoTag');
el.className = 'view--video__video';
var effect = filters[index++ % filters.length]
@DaveVoyles
DaveVoyles / image filters
Created May 29, 2015 15:58
Applying image and video filters to getUserMedia
/* image * video filters */
.grayscale {
-webkit-filter: grayscale(1);
-moz-filter: grayscale(1);
-ms-filter: grayscale(1);
filter: grayscale(1);
}
.sepia {
-webkit-filter: sepia(1);
@DaveVoyles
DaveVoyles / !navigator.getuserMedia
Last active August 29, 2015 14:22
Checking for getUserMedia, Modernizr
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
if (!navigator.getuserMedia) {
Console.log('You are using a browser that does not support the Media Capture API');
}
@DaveVoyles
DaveVoyles / Modernizr.getusermedia
Created May 29, 2015 15:55
Checking for getuserMedia
if (Modernizr.getusermedia) {
var getUM = Modernizr.prefixed('getUserMedia', navigator);
getUM({video: true}, function( //...
//...
}