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
/** | |
* chromeInstall | |
* a directive for inline install of a chrome extension from a website using Angular | |
* | |
* Make sure that the head meta data contains: | |
* <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/CHROME_EXTENSION_ID"> | |
*/ | |
yourApp.directive('chromeInstall', | |
[function() { | |
return { |
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
/** | |
* Module Starter | |
*/ | |
var NS = "ModuleName"; | |
// load the module into global | |
window[NS] = (function(){ | |
/** | |
* Internal - encapsulates all logic | |
* |
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
/** | |
* States | |
* A simple value store of states | |
*/ | |
D.value("States", [{ | |
"name": "Alabama", | |
"abbr": "AL" | |
},{ | |
"name": "Alaska", | |
"abbr": "AK" |
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
/** | |
* MediaFormat | |
* format and return only needed pieces of media from their public sources | |
* Author: Trevor Clarke | |
*/ | |
function MediaFormat (){ | |
// http://www.youtube.com/embed/m5yCOSHeYn4 | |
var ytRegEx = /^(?:https?:\/\/)?(?:i\.|www\.|img\.)?(?:youtu\.be\/|youtube\.com\/|ytimg\.com\/)(?:embed\/|v\/|vi\/|vi_webp\/|watch\?v=|watch\?.+&v=)((\w|-){11})(?:\S+)?$/; | |
// http://vimeo.com/3116167, https://player.vimeo.com/video/50489180, http://vimeo.com/channels/3116167, http://vimeo.com/channels/staffpicks/113544877 | |
var vmRegEx = /https?:\/\/(?:vimeo\.com\/|player\.vimeo\.com\/)(?:video\/|(?:channels\/staffpicks\/|channels\/)|)((\w|-){7,9})/; |
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 API (){ | |
this._apiString = ""; | |
//TODO: add this to check if we already have a param or not, then finish route | |
this.addQueryParam = function (){ | |
// console.log(this._apiString.toString().search("\?")); | |
} | |
this.v = function (){ |
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 setThis () { | |
firebaseRef.child('users').child(user.name).set(user); | |
}; | |
data.forEach(function (user) { | |
module.user(user.name, function(err, data){ | |
firebaseRef.child('users').child(user.name).update(user, setThis()); | |
}); | |
}); |
NewerOlder