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
#!/usr/bin/ruby | |
# A build script for this Maven-bullshit, because there's certain people here who don't | |
# actually *care* about this junk and just wanna get their work done. This is also meant to | |
# bring some semblance of sanity to alpha, because even though certain people have indicated that | |
# they don't wanna support it as an environment, they're still letting people code, build, and push | |
# from said environment. ;P | |
# | |
# This is meant to be run from your root webs directory/git repo. | |
# |
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 | |
require_once "Mail.php"; | |
/* This is a PHP script to handle form-mailing on Webfaction hosted accounts. | |
* | |
* Normal PHP mail scripts won't work due to the way Webfaction has their stuff set up, | |
* so this is a pretty decent workaround. It's a combination of various other efforts | |
* by different people who use Webfaction; if you feel you're not being credited for any | |
* of the effort/code below, feel free to email/message me on Github. I just want this to |
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
/* cssWalker.js | |
* | |
* Traverse every stylesheet in the document and filter based on their selectors. | |
* | |
* @Requires: Nothing, completely standalone. | |
* | |
* @Returns: An array of style objects/rules. The order of the array is determined by the point | |
* of the stylesheet in the document - e.g, first stylesheet rules are top of the array. | |
* | |
* @Author: Ryan McGrath (ryan@webs.com) |
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
/* The following chunk of code is just part of a generic page load-event handler. | |
* Notice that document.addEventListener is its own branch, the win32 portion | |
* shouldn't go in there... | |
*/ | |
if(document.addEventListener) { document.addEventListener("DOMContentLoaded", init, false); } | |
/*@cc_on @*//*@if (@_win32) document.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");script = document.getElementById("__ie_onload");script.onreadystatechange = function(){if(this.readyState == "complete") init();};/*@end @*/ | |
if(/WebKit/i.test(navigator.userAgent)) { /* Old Webkit versions, don't ask */ |
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"> | |
var vote = { | |
_cacheChecker: function(el) { this.el = el; }, | |
cast: function(el) { | |
var query = new vote._cacheChecker(el); | |
query.check(function() { | |
/* Since image loading is an asynchronous operation, | |
we'd need some kind of callback junk here. The beauty is that, | |
if you put your code to record a vote in this block, it'll only ever |
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"> | |
$(document).ready(function(){ | |
$('#slide_one').delay(2000).fadeOut(500, function() { | |
$('#slide_two').fadeIn(500).delay(2000).fadeOut(500, function() { | |
$('#slide_three').fadeIn(500).delay(2000).fadeOut(500, function() { | |
$('#slide_one').fadeIn(500); | |
}); | |
}); | |
}); | |
}); |
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
/* A bastard child of a DOM wrapper. Includes a beautiful clone of jQuery's | |
$(document).ready(...); without the bloat of the entire library. | |
*/ | |
Webs.DOM = { | |
/* An internal indicator as to whether or not we're still waiting on DOM ready. */ | |
loaded: false, | |
/* An internal indicator as to whether or not we've already started watching the DOM. */ | |
watchSet: false, | |
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
// Bad practice. Can you see why? | |
var foo = function() { alert("bar"); }; | |
setTimeout("foo()", 2000); |
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 foo = function() { alert("bar"); }; | |
// Better practice. Note how the function is passed this time. | |
setTimeout(foo, 2000); |
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
// Bad practice. Why concoct such an ugly string? | |
var delayedLol = function(laugh) { | |
setTimeout("alert('Laughing: " + laugh + "')", 2000); | |
}; | |
delayedLol("bwahahaha"); | |
// Instead, pass around your argument (laugh) with anonymous functions. | |
var delayedLol = function(laugh) { | |
setTimeout(function() { |