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(){ "use strict"; | |
if( !Array.protoype.isArray) ){ | |
Array.prototype.isArray = function( obj ){ | |
return Object.prototype.toString.call( obj || this ) === "[object Array]"; | |
}; | |
} | |
})(); |
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
(\s|\t)+?console\.[^;]+; |
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 tuenti_secure(string) { | |
var regexp1 = /^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/, | |
regexp2 = /\\./g, | |
regexp3 = /"[^"\\\n\r]*"/g; | |
if (!string || typeof string !== "string") { | |
return null; | |
} | |
if (regexp1.test(string.replace(regexp2, "@").replace(regexp3, ""))) { | |
return null; | |
} |
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
angular.module('app', []) | |
.directive('ngDisabled', [function(){ | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs){ | |
if(scope.$eval(attrs.ngDisabled)){ | |
element.attr('disabled', 'disabled'); | |
} | |
} | |
}; |
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-dl --max-quality mp4 {{link}} | |
ffmpeg -i {{arquivo baixado}} -ab 256000 -ar 44100 {{nome do arquivo de audio}}.mp3 |
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
angular.module('ng', []).directive('uppercase', function(){ | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, modelCtrl){ | |
// Cria o parsers | |
var _uppercase = function(inputValue){ | |
var uppercased = angular.uppercase(inputValue); | |
if(uppercased !== inputValue){ | |
modelCtrl.$setViewValue(uppercased); | |
modelCtrl.$render(); |
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
angular.module('ng', []).directive('removeSpecials', function(){ | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, modelCtrl){ | |
var clearString = function(inputValue){ | |
if(inputValue && inputValue.length){ | |
var cleanString = inputValue | |
.replace(/(^\s+)|(\s+$)/g, '') | |
.replace(/[\d\-\.\/\\\[\]\,\_\*\|\;\:\'\~\^\´\`\¨\%$$\@\!\(\)\=\+\#\¹\²\³\£\¢\¬\&<\>\°\º\ª\?]/g, '') | |
.replace(/\s+/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
function crescente (index1, index2){return index1 - index2;} | |
function decrescente (index1, index2){return index2 - index1;} | |
var ar = [2, 5, 4, 9, 1, 3, 6, 7, 8, 0]; | |
ar.sort(crescente); | |
ar.sort(decrescente); |
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
/************************* | |
Cross Browser Gradient Backgrounds | |
v1.0 | |
Last Revision: 11.03.2005 | |
steve@slayeroffice.com | |
please leave this notice in tact. | |
should you improve upon this code, please |
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 trocarcss(title) { | |
var i, a, main; | |
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { | |
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { | |
a.disabled = true; | |
if(a.getAttribute("title") == title) a.disabled = false; | |
} | |
} | |
} |