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
<?php | |
/* | |
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:: | |
:: GIFEncoder Version 2.0 by László Zsidi, http://gifs.hu | |
:: | |
:: This class is a rewritten 'GifMerge.class.php' version. | |
:: | |
:: Modification: | |
:: - Simplified and easy code, |
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 bubble_sort(values) { | |
var length = values.length - 1; | |
do { | |
var swapped = false; | |
for(var i = 0; i < length; ++i) { | |
if (values[i] > values[i+1]) { | |
var temp = values[i]; | |
values[i] = values[i+1]; | |
values[i+1] = temp; | |
swapped = true; |
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 insertion_sort(values) { | |
var length = values.length; | |
for(var i = 1; i < length; ++i) { | |
var temp = values[i]; | |
var j = i - 1; | |
for(; j >= 0 && values[j] > temp; --j) { | |
values[j+1] = values[j]; | |
} | |
values[j+1] = temp; | |
} |
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
$('html').mousemove(function(e){ | |
console.log("X Axis Position = " + e.pageX + " and Y Axis Position = " + e.pageY); | |
}); |
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 browser = function() { | |
// Return cached result if avalible, else get result then cache it. | |
if (browser.prototype._cachedResult) | |
return browser.prototype._cachedResult; | |
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; | |
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera) | |
var isFirefox = typeof InstallTrigger !== 'undefined';// Firefox 1.0+ | |
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; | |
// At least Safari 3+: "[object HTMLElementConstructor]" |
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
jQuery.preloadImagesInWebPage = function() { | |
for (var ctr = 0; ctr < arguments.length; ctr++) { | |
jQuery("<img>").attr("src", arguments[ctr]); | |
} | |
} | |
//Carregando as imagens | |
$.preloadImages("image1.gif", "image2.gif", "image3.gif"); | |
//verificar se imagem foi carregada. | |
$('#imageObject').attr('src', 'image1.gif').load(function() { | |
alert('A imagem foi carregada'); |
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 squares = [1,2,3,4].map(function (val) { | |
return val * val; | |
}); |
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 numbers = [-215, 458 ,5, , 120 , 584 , 228 , 400 , 122205, -85411]; | |
var max = Math.max.apply(Math, numbers); | |
var min = Math.min.apply(Math, numbers); |
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 arr = [25,477,244,5872,145,8,778,2,21,4]; | |
var random = arr[Math.floor(Math.random() * arr.length)]; |
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 isNumber(n){ | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} |
NewerOlder