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
/* | |
Copyright 2014 Google Inc. All Rights Reserved. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and |
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
// ref https://remysharp.com/2010/07/21/throttling-function-calls | |
function fThrottle(fn, threshhold, scope) { | |
threshhold || (threshhold = 250); | |
var last, | |
deferTimer; | |
return function () { | |
var context = scope || this; | |
var now = +new Date, | |
args = arguments; |
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
// ** | |
// Recurso de infinite scroll, deve ser usado apenas um por página | |
// uma página não deve ter mais que 2 chamadas de infinite scroll | |
(function infiniteScrollInit() { | |
var infiniteScrollCalled = false | |
function fInfiniteScroll(callback) { | |
// get fThrottle https://gist.github.com/felquis/299029971e40ad040b34 | |
document.addEventListener('scroll', fThrottle(onScroll, 300)) |
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
/** | |
Minimal CSS Reset | |
reset margins, paddings and line-heights of every element needed | |
if you need paddings into li, dl, dd elements, just remove them | |
from the selector below | |
Felquis Gimenes | |
MIT Licence | |
https://gist.github.com/felquis/1278d5f62dcc5f606bbb |
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
/*1443789044,,JIT Construction: v1968057,pt_BR*/ | |
/** | |
* Copyright Facebook Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
*/ | |
try { | |
window.FB || (function(window) { |
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
/* | |
Return the same of `.get(index)` method, | |
but if the return of `.get` is undefined | |
this method will return an empty array `[]` | |
and NOT an `undefined` | |
Useful to make sure things wont break if | |
an element isn't in the DOM | |
*/ | |
var getThat = function (index) { |
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 styles = document.querySelectorAll('link[rel="stylesheet"], style') | |
styles = nodeListToArray(styles) | |
function nodeListToArray(nodeList) { | |
return Array.prototype.slice.call(nodeList) | |
} | |
function removeNode(node) { | |
node.parentElement.removeChild(node) | |
} |
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 styles = document.querySelectorAll('link[href$=".css"]') | |
styles = nodeListToArray(styles) | |
function nodeListToArray(nodeList) { | |
return Array.prototype.slice.call(nodeList) | |
} | |
function removeNode(node) { | |
node.parentElement.removeChild(node) | |
} |
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
// I figured out this function looks like RequireJS's `define` function | |
// but I couldn't find a source or resource to help me understand this code | |
// I'll appreciate some help, links to clearly docs | |
// NOTE: I'm not interested in how RequireJS works, cause it's source code is huge, | |
// I just want to understand how the code bellow works. Maybe the source above documented | |
// | |
// | |
// I think it's a output file from browserify or some tool like that | |
function define(modules, n, r) { |
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
shell: { | |
facebookDownload: { | |
command: [ | |
'echo "## Downloading Facebook Plugin"', | |
'git clone git@github.com:Wizcorp/phonegap-facebook-plugin.git .tmp-plugin/phonegap-facebook-plugin/', | |
'cd .tmp-plugin/phonegap-facebook-plugin/', | |
'echo "## Checkout tag v0.11.0"', | |
'git checkout v0.11.0 -q', | |
'cd ./../../' |