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
// Adapted from code provided by 37Signals on their Signal vs. Noise blog. | |
// Added support for Twitter date parsing. | |
// Call DateHelper.time_ago_in_words_with_parsing(twitter_date_as_string) to use. | |
var DateHelper = { | |
date_parse_from_twitter: function(str){ | |
parts = str.match(/^([a-z]{3}) ([a-z]{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) \+(\d{4}) (\d{4})$/i); | |
if(!parts) return false; | |
var date_str = parts[1] + ", " + parts[3] + " " + parts[2] + " " + parts[8] + " " + parts[4] + ":" + parts[5] + ":" + parts[6] + " GMT"; |
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
/* | |
* jQuery fasterTrim Plugin | |
* version: 1.0.1 | |
* @requires jQuery v1.0.x or later | |
* | |
* licensed under the MIT license: | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* @version $Id: jquery.fastertrim.js 2 2010-03-04 12:00:00Z $ | |
* @author Travis Hardiman https://forum.jquery.com/user/travis.hardiman http://travis.servebeer.com |
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
/* | |
* jQuery UI CSS Framework | |
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) | |
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. | |
* To view and modify this theme, visit http://jqueryui.com/themeroller/ | |
*/ | |
/* Component containers | |
----------------------------------*/ |
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
(function($){ | |
$.widget('pixel.countdown', { | |
options: { | |
milestones: [ | |
{ label: "one_minute", minute: 1 }, | |
{ label: "five_minutes", minute: 5, second: 30 } | |
], | |
interval: 1, // Interval in seconds to refresh the widget | |
formatter: function(min, sec){ |
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
// How I normally did it: | |
(function ($) { | |
var global = { | |
// ... | |
}; | |
window.global = global; |
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
// Valid | |
var myFunction = function () { }; | |
var myFunction = function (first, second, third) { }; | |
function myFunction() { } | |
function myFunction(first, second, third) { } | |
d = 1 + 2 / (3 * 5); | |
if (test === true) { |
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
// Private Scope | |
(function ($) { | |
var variable = "Hello"; | |
}(jQuery)); | |
alert(typeof variable); // undefined | |
// Private Scope, Public Variable | |
var variable = (function ($){ | |
var first = "Hel", second = "lo"; |
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
a:after { | |
... | |
content: attr(title); /* Default to title */ | |
... | |
}; | |
html.js a:after { | |
... |
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
/*! | |
* jQuery TextChange Plugin | |
* http://www.zurb.com/playground/jquery-text-change-custom-event | |
* | |
* Copyright 2010, ZURB | |
* Released under the MIT License | |
*/ | |
(function ($) { | |
$.event.special.textchange = { |
OlderNewer