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
Array.prototype.max = function() { | |
return Math.max.apply(Math, this); | |
} | |
Array.prototype.min = function() { | |
return Math.min.apply(Math, this); | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Simple Test Suite</title> | |
<script> | |
(function(){ | |
var queue = [] | |
var paused = false | |
var results; |
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
/** | |
* Creates and enum from the object based on key values | |
* | |
* @param {object} Object | |
* @return {object} enum from object | |
*/ | |
function buildEnumFromObject_(obj){ | |
var createdEnum = {}; | |
var i = 0; |
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
img { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\' filterRes=\'800\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+ */ | |
filter: gray; /* IE6-9 */ | |
-webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */ | |
-webkit-backface-visibility: hidden; /* Fix for transition flickering */ | |
-webkit-transition: all 0.5s ease; | |
-moz-transition: all 0.5s ease; | |
-ms-transition: all 0.5s ease; | |
-o-transition: all 0.5s ease; | |
transition: all 0.5s ease; |
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 urlify(text){ | |
var urlRegex = /(([a-z]+:\/\/)?(([a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(\s+|$)/gi; | |
return text.replace(urlRegex, function(url){ | |
return '<a href="' + url + '">' + url + '</a>'; | |
}); | |
}; |
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
/** | |
* @author Rob W <[email protected]> | |
* @website http://stackoverflow.com/a/7513356/938089 | |
* @version 20120724 | |
* @description Executes function on a framed YouTube video (see website link) | |
* For a full list of possible functions, see: | |
* https://developers.google.com/youtube/js_api_reference | |
* @param String frame_id The id of (the div containing) the frame | |
* @param String func Desired function to call, eg. "playVideo" | |
* (Function) Function to call when the player is ready. |
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
<script type="text/javascript"> | |
function youtube_parser(url){ | |
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/; | |
var match = url.match(regExp); | |
if (match&&match[7].length==11){ | |
return match[7]; | |
}else{ | |
alert("Url incorrecta"); | |
} | |
} |
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
// FROM http://orderedlist.com/blog/articles/live-search-with-quicksilver-style-for-jquery | |
(function($) { | |
var self = null; | |
$.fn.liveUpdate = function(list) { | |
return this.each(function() { | |
new $.liveUpdate(this, list); | |
}); | |
}; | |
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
$.preloadImages = function(){ | |
for(var i = 0; i < arguments.length; i++){ | |
$("<img />").attr("src", arguments[i]); | |
} | |
}; |
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($){ | |
})(jQuery); |
NewerOlder