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 a_good_method | |
Logger.log(self, "This is a call to a static log method") | |
# do some other thing here | |
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
#!/usr/bin/ruby | |
module BaseModule | |
def cry | |
p "wa wa wa waaa" | |
end | |
end | |
module ExtendedModule | |
include BaseModule |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Net; | |
using System.Threading.Tasks; | |
namespace AsyncCSharp | |
{ | |
class Program |
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
$.ajax({ | |
url: '/blog/posts/' + tag_name. | |
type: 'DELETE', | |
... | |
}); |
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
#example code to cancel subscription | |
Customer.find('John Fake').tv_channel_subscriptions.find(:nat_geo).cancel!(1.month.from_now) | |
class Customer | |
attr_accessor :name, :start_date, :end_date | |
has_many :tv_channel_subscriptions | |
end | |
class TvChannelSubscription |
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
public void processMessage(Object message){ | |
if(message instanceof CleanFloor){ | |
((CleanFloor) message).cleanKitchen(); | |
} | |
elsif(message instanceof LaunchRocket){ | |
((LaunchRocket) message).shootToMoon(); | |
} | |
} |
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
public void processMessage(CleanFloor cleanFloor){ | |
cleanFloor.cleanKitchen(); | |
} | |
public void processMessage(LaunchRocket launchRocket){ | |
launchRocket.shootToMoon(); | |
} |
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> | |
.container{ | |
width: 10%; | |
height: 10%; | |
float: left; | |
background-color: green; | |
border: 1px solid #00FF 00; |
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
<% products.each do |product| %> | |
<div class="product" id="product_<%= product.id %>"> | |
<%= link_to_image product.thumbnail, product %> | |
<%= product.name %> | |
... | |
</div> | |
<% 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
$('.div.product').click(showScreenshots) | |
showScreenshots = function(){ | |
selectedProductId = $(this).id.split('_')[1] | |
//load the screenshots for the product with id = selectedProductId | |
} |