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
1 #!/usr/bin/ruby | |
2 require 'pp' | |
3 | |
4 module Larry | |
5 def foo_cluster; | |
6 puts "in foo_cluster" | |
7 puts "<<#{__method__}>>" | |
8 end | |
9 def foo_cluster_alpha; puts "in foo_cluster_alpha" ; end | |
10 def foo_cluster_beta; puts "in foo_cluster_beta" ; 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
sgharms@stharms-mac:~/gitcheckouts/rdoc$ rake test | |
e(in /Users/sgharms/gitcheckouts/rdoc) | |
rake aborted! | |
undefined method `plugin' for Hoe:Class | |
/Users/sgharms/gitcheckouts/rdoc/Rakefile:5:in `<top (required)>' | |
(See full trace by running task with --trace) | |
sgharms@stharms-mac:~/gitcheckouts/rdoc$ gem install hoe-git | |
ERROR: Error installing hoe-git: | |
hoe requires RubyGems version >= 1.4. Try 'gem update --system' to update RubyGems itself. | |
sgharms@stharms-mac:~/gitcheckouts/rdoc$ gem update --system |
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
#!/usr/bin/env ruby | |
module Magic | |
def self.active_voice_indicative_mood_present_tense(spec) | |
puts "hey you called me, with an argument of #{spec}" | |
end | |
end | |
class Zabu | |
def razzle |
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
#!/usr/bin/env ruby | |
# | |
foo = [] | |
0.upto 5 do |i| | |
- foo[i] = {} | |
end | |
foo[0]['jackpot'] = 100 | |
foo[1]['jackpot'] = 200 | |
foo[2]['jackpot'] = 500 | |
foo[3]['jackpot'] = 300 |
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
Woman = (function() { | |
__extends(Woman, Primate); | |
function Woman(name) { | |
this.name = name != null ? name : 'Eve'; | |
this.likes = []; | |
} | |
Woman.prototype.supply_likes = function() { | |
this.likes.push("someStuff"); | |
return this.likes.push("someOtherStuff"); |
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
#=============================================================================== | |
## INITIAL PAGE VISIT ## | |
#=============================================================================== | |
GET /tasks (no params) | |
Processing by TasksController#index as HTML | |
Employee Load (0.5ms) SELECT "employees".* FROM "employees" WHERE "employees"."id" = 1 LIMIT 1 | |
Task Load (0.9ms) SELECT DISTINCT(completed_on) FROM "tasks" WHERE "tasks"."employee_id" = 1 AND (completed_on <= '2012-01-12') ORDER BY completed_on DESC LIMIT 5 |
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 Employee < ActiveRecord::Base | |
... | |
def recent_tasks(options = {}) | |
completed_on = if options[:completed_on].present? | |
Date.parse options[:completed_on] | |
else | |
Date.current | |
end | |
completed_on = 2.business_days.after(completed_on.to_time).to_date |
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
<a id="previous" href="#"></a> | |
<% for task in @tasks: %> | |
<span class="date <%= task.status() %>" data-date="<%= task.get 'completed_on' %>"> | |
<p class="time"><%= task.get 'time' %></p> | |
<p class="name"><%= Date.parse(task.get('completed_on')).toString 'ddd' %></p> | |
<p class="range"> | |
<a href="#"><%= Date.parse(task.get('completed_on')).toString 'MM/dd' %></a> | |
</p> | |
</span> | |
<% 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
class Timesheet.Views.DateScrollView extends Backbone.View | |
el: '.DateScrollPane' | |
template: JST['tasks/date_scroll_view'] | |
initialize: -> | |
@collection.bind 'reset', @render | |
... | |
@model.bind 'change:completed_on', @refreshSelection | |
... | |
render: => | |
completedOn = Date.parse @model.get('completed_on') |
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
<script type="text/javascript"> | |
/* | |
* Add this to the top of your post. This will get interpreted in and applies to your page | |
* e.g. | |
* | |
* (this code) | |
* | |
* # My Summer Vacation | |
* |