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
angular | |
.module('myApp') | |
.run(function(){ | |
//The app is initialised. | |
}); | |
//Get Firebase auth | |
var ref = new Firebase('https://<!--FIREBASEURL-->.com'), | |
auth = ref.getAuth(); |
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
if (_button){ | |
_button.action = callback; | |
//Bind params | |
if(params) _button.action = _button.action.bind.apply(_button.action, [null].concat(params)); | |
} |
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 scroll = function(){ | |
if ($(window).scrollTop() + $(window).height() > $(document).height() - 50) { | |
//Do something | |
} | |
} | |
//Add/remove function from $(window) | |
$(window).on('scroll', scroll); | |
$(window).off('scroll', scroll); |
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
.vdiv | |
{ | |
display:table; | |
position:absolute; | |
width: 100%; | |
height:100%; | |
} | |
.vdiv > div | |
{ |
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
//$ npm install -g grunt-cli | |
// | |
//$ npm install grunt-contrib-concat --save-dev | |
//$ npm install grunt-contrib-uglify --save-dev | |
//$ npm install grunt-contrib-cssmin --save-dev | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), |
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
//$ npm install --global gulp | |
// | |
//$ npm install | |
//$ npm install --save-dev gulp | |
//$ npm install --save-dev gulp-concat | |
//$ npm install --save-dev gulp-uglify | |
//$ npm install --save-dev gulp-cssmin | |
//$ npm install --save-dev gulp-ng-annotate | |
var gulp = require('gulp'), |
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
//Encode | |
function encodeBase64( string ){ | |
try{ | |
if( typeof string == 'object'){ | |
throw 'error'; | |
} | |
return window.btoa(unescape(encodeURIComponent( string ))); | |
} catch(e){ | |
return false; |
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
<?php | |
function sc_pagination( $query ){ | |
$string = ""; | |
if( !$query ){ | |
global $wp_query; |
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 ui = { | |
buildMarkers: function( data, first ){ | |
var results = []; | |
$.each( data, function(i, marker){ | |
var html = ui.buildHTML( marker.title, marker.address, marker.telephone ); |