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
// Procedure to obtain the background cover effect whichs works on small or large screens | |
html { | |
background: url(url_to_img) no-repeat center center fixed; | |
background-size: cover; | |
height: 100%; | |
overflow: hidden; | |
} | |
body |
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
// Using a scaled and filtered gif as background | |
.background { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 20%; | |
height: 20%; | |
z-index: -1; | |
background-image: url('http://37.media.tumblr.com/tumblr_lupg946u5S1qe0eclo1_r5_500.gif'); |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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() { | |
var ClassName, root; | |
function ClassName (config) { | |
var privateProperty = 24; | |
this.publicProperty = 42; | |
privateMethod = function (foo) { |
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
/** | |
* Originally from http://www.abeautifulsite.net/detecting-mobile-devices-with-javascript/ | |
**/ | |
var isMobile = { | |
Android: function() { | |
return navigator.userAgent.match(/Android/i); | |
}, | |
BlackBerry: function() { | |
return navigator.userAgent.match(/BlackBerry/i); |
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
var app = angular.module('capeloMod', []); | |
app.service('demoService', function() { | |
this.publicValue = 0; | |
var privateValue = 0; | |
var privateFn = function() { | |
return 1 + 2; | |
}; |
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
var app = angular.module('capeloMod', []); | |
//factory style, more involved but more sophisticated | |
app.factory('demoFactory', function() { | |
var publicValue = 0; | |
var privateValue = 0; | |
function apiFn() { | |
return this.publicValue++; | |
} |
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
var app = angular.module('capeloMod', []); | |
app.provider('demo', function() { | |
var cfg = 'Default'; | |
this.setCfg = function(providedCfg) { | |
cfg = providedCfg; | |
}; | |
this.$get = ['dependencyName', function(dependency) { | |
return new dependency(cfg); |
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 ClassName(name) { | |
this.name = name; | |
} | |
ClassName.prototype = { | |
constructor: ClassName, | |
greet: function () { | |
return 'My name is' + this.name; | |
} | |
}; |
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(global) { | |
function OOPPattern(value) { | |
this.publicInstanceValue = value || 10; | |
var privateValue = 0; | |
var privatFn = function(argument) { | |
return 1 + 2; | |
} | |
this.api2NeedsPrivateValue = function(argument) { |
OlderNewer