Skip to content

Instantly share code, notes, and snippets.

View notbrain's full-sized avatar

Brian Ross notbrain

View GitHub Profile
# 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
can i only embed public gists?
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}"
// 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++) {
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
@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');
// 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 / play_upstart_starter.sh
Created July 21, 2011 17:25
upstart playframework launch script
# upstart play framework script
# thanks to:
# http://geeknme.wordpress.com/2009/10/15/getting-started-with-upstart-in-ubuntu/
# this script will start/stop play framework
# place in /etc/init
description "start and stop the play framework"
version "1.0"
author "Brian Ross"
@notbrain
notbrain / array_fits_into_another.java
Created September 10, 2011 16:53
Function to return whether or not one 'design' array 'fits' into another 'max'
// Currently incomplete implementation!
private Boolean designFits(int[] max, int[] design) {
Boolean designFits = true;
Arrays.sort(max);
Arrays.sort(design);
int passCount = 0;
if(design.length <= max.length) {
@button_height: 42px;
@button_width: 159px;
a.buttonBuyNow {
width: @button_width;
height: @button_height;
background: transparent url(/img/home-leader/buyNowSprite.png) 0px 0px no-repeat scroll;