Skip to content

Instantly share code, notes, and snippets.

View notbrain's full-sized avatar

Brian Ross notbrain

View GitHub Profile
// prevent tabbing from moving the slides around
// intercept with preventDefault and tab back to field with initial focus class based on current slide #
$(".tabBackToInitialFocus").keydown(function(event){
if(event.keyCode == 9) { // tab key
event.preventDefault();
// currentSlideNumber is set after each navigation action (click on "Next"/"Back" buttons, etc)
$(".initialFocus" + currentSlideNumber).select();
}
});
@notbrain
notbrain / globalMessage.js
Created April 22, 2011 22:09
globalMessage.js WIP
(function($){
var methods = {
init: function(options) {
log("init");
var $this = this;
var opts = $.extend({}, $.fn.globalMessage.defaults, options);
var data = $this.data('globalMessage');
function getAjaxResultAndReturnIt() {
$.getJSON("/url", function(json){
if(json.result) {
return true; // will not bubble up as return of function call
} else {
return false; // will not bubble up as return of function call
// 1234567
// racecar
// 0123456
// >>>X<<< close in on it, only need half the length of word loopage
function is_palindrome(word) {
var outcome = true;
for(i = 0; i <= (word.length / 2); i++) {
Array {
[column_1_label] => "Initial Payment"
[column_1_tier_1_value] => "{UpfrontCost}"
[column_1_tier_1_footnote] => ""
[column_1_tier_2_value] => ""
[column_1_tier_2_footnote] => ""
[column_2_label] => "20 Year Savings"
[column_2_tier_1_value] => "{20YearSavings}"
[column_2_tier_1_footnote] => ""
[column_2_tier_2_value] => "{FederalLocalRebateSum}"
can i only embed public gists?
# This works
def welcome_email(email)
recipients email.email
subject "Welcome to PeerPong!"
sent_on Time.now
body :email => email.email
from "peerpong@peerpong.com"
reply_to "peerpong@peerpong.com"
end