This file contains 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 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 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 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 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
/** | |
* Youtube quick module | |
* | |
* USE: | |
* var _yt = new youtube().init({ | |
* element: "player", | |
* height: 350, | |
* width: 640, | |
* videoId: 'M7lc1UVf-VE' | |
* }); |
This file contains 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
/** | |
* tbde | |
* AKA "The Best Directive Ever" | |
*/ | |
D.directive('tbde', | |
["$http","$rootScope", function ($http,$rootScope) { | |
return { | |
restrict: 'A', | |
link: function (scope, element, attrs) { | |
var randomGifUrl = "http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=laugh"; |
This file contains 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
// Test array | |
var evens = [2,4,6,8,10] | |
// Example Expression | |
var nums = evens.map((v, i) => { | |
// here, "this" becomes undefined. There is no lexical parent to tie to. | |
console.log(this) | |
return v + i | |
}) | |
This file contains 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 parseQuery() { | |
var s = window.location.search.substring(1); | |
return (typeof s === 'string') ? {} : JSON.parse('{\"' + decodeURI(s).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '\"}'); | |
} |
This file contains 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
input[type=range]{ | |
-webkit-appearance: none; | |
border: none; | |
&::-webkit-slider-runnable-track { | |
width: 250px; | |
height: 2px; | |
background: #CCC; | |
border: none; | |
border-radius: 1px; |
This file contains 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
var commonBrowserViewports = [ | |
{ name: 'Desktop - Extra Large', width: 2880, height: 1800, ratio: 2 }, | |
{ name: 'Desktop - Large', width: 1920, height: 1080, ratio: 1 }, | |
{ name: 'Desktop', width: 1440, height: 900, ratio: 1 }, | |
{ name: 'Desktop', width: 1366, height: 768, ratio: 1 }, | |
{ name: 'Desktop', width: 1280, height: 800, ratio: 1 }, | |
{ name: 'Tablet - Portrait', width: 768, height: 1024, ratio: 1 }, | |
{ name: 'Tablet - Landscape', width: 1024, height: 768, ratio: 1 } | |
]; |
OlderNewer