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
class Person | |
def initialize(name, children = []) | |
@children = children | |
@descendents = [] | |
@name = name | |
end | |
def get_all_descendents |
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
<html> | |
<head> | |
<style> | |
#wrapper{} | |
.box{float: left; border: 1px solid black;} | |
#main{width: 500px; height: 500px;} |
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
function PoorMansGloveBox(element) { | |
this.element = element; | |
this.parentHeight = this.element.parentNode.clientHeight; | |
this.element.style.position = 'relative'; | |
this.element.style.top = '0px'; | |
this.lastPos = 0; | |
this.currentPos = 0; | |
var self = this; | |
this.element.addEventListener('touchstart', function(e){ | |
self.lastPos = e.touches[0].pageY; |
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
#showlinks | |
[email protected] do |link| | |
%p= link_to( link.title, link.url, :title => link.title, :target => '_blank' ) | |
#linknote | |
%p Send this link to your friends: | |
%b | |
%a{:href => "/" } Dude | |
/ This works, but I am trying to put @instance_variable in the "/" and the "Dude" |
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
class Order < ActiveRecord::Base | |
def processing_fee | |
packages_with_processing_fees = ['Package', 'FamilyPackage', 'LadiesPackage', 'CompletePackage'] | |
fee = 0 | |
# Only apply fee if cart contains an item with processing fees | |
fee = 3.00 if line_items.any? {|line_item| packages_with_processing_fees.include? line_item.item.class.to_s } | |
if customer |