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
// "Cheat" special event using this pattern: | |
// http://benalman.com/news/2010/03/jquery-special-events/#pattern | |
// | |
// Also see: | |
// http://benalman.com/news/2010/03/jquery-special-events/#add-and-remove-tripleclick-per-handler | |
(function($){ | |
$.event.special.cheat = { | |
setup: function() { |
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
/*! | |
* Prototype throttle / debounce - v1.1 - 4/27/2010 | |
* http://benalman.com/projects/jquery-throttle-debounce-plugin/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
(function(window,proto,undefined){ |
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
_____, to be completely honest, I'm just too busy maintaining these | |
plugins and writing articles about plugin development to be able to | |
help with specific implementations. The examples and documentation | |
I've already taken the time to create are usually sufficient for most | |
developers looking to implement _____ in their website. | |
If you are experiencing a very specific problem, feel free to stop | |
into the official jQuery IRC channel for help with that specific | |
issue. Also, if you choose to recognize the hard work I've put into | |
any of my projects with a donation, it would be greatly appreciated. |
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
/*! | |
* bindAndTrigger - v0.1 - 04/30/2010 | |
* http://benalman.com/ | |
* | |
* http://jsfiddle.net/cowboy/fJnA2/ | |
*/ | |
(function($,undefined){ | |
$.fn.bindAndTrigger = function( all, type, data, callback ) { |
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
window.alert && alert( 'omg hi!' ); |
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
set minX to 0 | |
set minY to 22 | |
tell application "Finder" to set screen_resolution to items 3 thru 4 of (get bounds of desktop's window) | |
set maxX to item 1 of screen_resolution | |
set maxY to item 1 of screen_resolution | |
--set maxX to (do shell script "echo $(defaults read /Library/Preferences/com.apple.windowserver) | sed 's/.*Width = \\([0-9]*\\);.*/\\1/'") as number | |
--set maxY to ((do shell script "echo $(defaults read /Library/Preferences/com.apple.windowserver) | sed 's/.*Height = \\([0-9]*\\);.*/\\1/'") as number) - 4 |
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
(* | |
* Restart App - v1.0 - 5/19/2010 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*) | |
-- Usage: |
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
// Disable backspace in non-form elements in Chrome | |
// TODO: add input type, disabled and element contenteditable checks | |
(function(window){ | |
window.addEventListener( 'keydown', handler, true ); | |
window.addEventListener( 'keypress', handler, true ); | |
function handler(e) { | |
!/^(?:textarea|input)$/i.test( e.target.nodeName ) && e.keyCode == 8 && e.preventDefault(); |
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
<?php | |
## Parse query string. | |
$sb_league = $_GET['league'] ? strtolower( $_GET['league'] ) : 'all'; | |
## Nav data, as a JSON heredoc. Much less verbose than PHP arrays! | |
$navs = json_decode(<<<JSON | |
{ | |
"mlb": { | |
"title_link": "http://stats.boston.com/mlb/scoreboard.asp", |
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
#!/bin/bash | |
function print_usage { | |
cat <<PRINT_USAGE | |
Usage: $(basename $0) [ -start | -restart | -check | -info ] | |
-start start ssh session (connect to remote server) | |
-restart force-restart ssh session |