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
14149,16064,20369,18857,17446,17001,16804,16317,17168,37466,20640,15042,16448,15621,58503,12901,11250,13372,13047,11426,12373,19340,12338,12841,15391,15549,22256,19621,16421,18541,22570,17363,13027,16061,19582,15627,15630,16113,23945,16509,17513,19890,38230,23731,34761,23352,59812,31053,43482,34847,33319,24535,35282,33337,43822,36717,32577,189734,75559,33348,212749,28522,23072,32974,32096,27123,68467,27814,29473,27013,59698,21919,27556,29756,42608,24942,21646,26582,19744,4247, |
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
<?php | |
$myName = "Janel"; | |
echo "<h3>" . $myName . " loves Shapeways.</h3>"; | |
?> |
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
$('#playlist_title').on('click', '.delete-button', function() { | |
ajaxDeletePlaylist(); | |
}); |
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
#You can use strftime to format expiration date in variety of acceptable ways | |
def js_date | |
self.expiration.strftime("%c") | |
end | |
#=>"Tue Jul 15 14:17:22 2014" | |
def js_date | |
self.expiration.strftime("%D %T") | |
end | |
#=> "07/15/14 14:17:22" |
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 () { | |
var expiration = $('#countdownClock').data('expiration'); | |
$('#countdownClock').countdown({until: new Date(expiration)}); | |
}) |
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
<div id="countdownClock" data-expiration="<%=@poll.js_date%>"> | |
</div> |
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
rails console production --sandbox |
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
#First call instance_method on a class to get hold of a method object | |
#We can then ask the method object where it is defined using source_location | |
location = Pond.instance_method(:cool_method).source_location | |
#=> ["/Users/JaneldiBiccari/Development/code/rails_labs/rails-blog-nested-resources-bk-001/app/models/post.rb", 9] | |
#Now open to that location | |
`subl #{location[0]}:#{location[1]}` |
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
#Normal output | |
pond = Pond.last | |
#=> #<Pond id: 9, name: "Greenwood", water_type: "Murky", created_at: "2014-06-26 16:32:39", updated_at: "2014-06-26 16:32:39"> | |
#To yaml! | |
y pond | |
--- !ruby/object:Pond | |
attributes: | |
id: 9 |
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
#Using the underscore here is a bit lazy | |
#but you get the idea | |
Pond.all | |
ponds = _ | |
#=> <ActiveRecord::Relation [#<Pond id: 7, name: "Silver Frost", water_type: "Glass"...] |
NewerOlder