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
BankImportLineItemAllocationHelper = Class.create({ | |
new: function(bank_import_line_item_id, request) { | |
bank_import_line_item = $('bank_import_line_item_' + bank_import_line_item_id) | |
actions = $$('#' + bank_import_line_item.id + ' .actions').first() | |
actions.hide() | |
partial = request.responseText | |
Element.insert(actions, {before: partial}) | |
} | |
}) | |
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
ENV["I_LIKE_METHOD_ALIAS_CHAIN"] = "true" | |
require 'rubygems' | |
require 'haml' | |
# performance optimizations. | |
load 'paml.rb' | |
pml = Paml.new | |
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 Dog | |
attr_accessor :animal_type | |
%w(cats dogs rabbits pigs cows).each do |t| | |
define_method "has_#{t}" do |number| | |
@animal_type = t | |
puts number | |
end | |
end | |
end | |
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 OffshoreForm = Class.create({ | |
initialize: function() { | |
}, | |
listen_for_load: function() { | |
var self = this | |
Event.observe(window, 'load', function() { | |
self.enter_initial_state() | |
}) | |
}, |
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
/%img{:src=>"/assets/trans_bg.png", :style=>"display:none;"} | |
.container | |
= templates.backgrounds | |
/= templates.top_nav | |
#navigation_overlay | |
#left | |
%a{ :href => "/"} | |
%img.logo{:src=>"/assets/astra_logo.png", :alt=>"Astra 2009", :style => "width: 164px; height: 141px;"} |
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
# Thursday | |
- 9:00 Writing Large Applications in JavaScript: Douglas Crockford | |
- 11:15 How to build an iPhone application in 45 minutes: Patrick Linskey | |
- 13:00 Domain Specific Languages and Language Oriented Programming: Amanda Laucher | |
- 14:00 Speeding Ducks: Avi Bryant | |
- 15:15 Fuzz-Testing Rails Apps with Tarantula: Glenn Vanderburg | |
- 16:15 How to do write tests/stories for RubyGems and Rails plugins: Dr Nic | |
- 17:15 Atlassian: An Australian Success Story: Mike Cannon-Brookes |
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
registration_count = {} | |
Registration.find_all_by_complete(true).each do |reg| | |
date = reg.sydney_updated_at.to_date | |
if registration_count.key? date | |
registration_count[date] += 1 | |
else | |
registration_count[date] = 1 | |
end | |
end | |
registration_count.inspect |
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
<ul id="recommendations"></ul> | |
<script type="text/javascript"> | |
function display_recommendations(recommendations) { | |
$A(recommendations).each(function(recommendation) { | |
var li = new Element('li'); | |
var a = new Element('a', {'href': '/products/' + recommendation.handle}).update(recommendation.title); | |
var img = new Element('img', {'src': Shopify.resizeImage(recommendation.images.first().src, 'small')}); | |
var image_link = new Element('a', {'href': '/products/' + recommendation.handle}).update(img); | |
li.insert(new Element('h4').update(a)); | |
li.insert(image_link); |
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
// Original version. | |
findElements: function(root) { | |
root = root || document; | |
var e = this.expression, results; | |
switch (this.mode) { | |
case 'selectorsAPI': | |
// querySelectorAll queries document-wide, then filters to descendants | |
// of the context element. That's not what we want. | |
// Add an explicit context to the selector if necessary. |
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
def create_recurring_billing_unless_already_billed | |
unless ShopifyAPI::RecurringApplicationCharge.current | |
ShopifyAPI::RecurringApplicationCharge.create :name => 'Standard', :price => 10.0, :return_url => 'http://werecommendapp.com/' | |
end | |
end |
OlderNewer