#Setting up your project on CircleCI
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 CommentsController | |
def create | |
comment = Comment.new(params[:comment]) | |
@comment = CommentCreator.new(comment).create! | |
respond_with @comment | |
end | |
end | |
class CommentCreator | |
def initialize(comment) |
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 CommentCreator | |
#... | |
def perform | |
ThreadParticipantsNotifier.new(@comment).notify | |
CommentReplyNotifier.new(@comment).notify | |
Kissmetrics.record(comment.author, 'Added Comment') | |
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
class CommentCreator | |
#... | |
def perform | |
ThreadParticipantsNotifier.new(@comment).notify | |
if comment.previous_comment? | |
in_reply_to_user = comment.previous_comment.author | |
ReplyMailer.notification(in_reply_to_user, comment).deliver | |
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 CommentsController | |
def create | |
comment = Comment.new(params[:comment]) | |
@comment = CommentCreator.new(comment).create! | |
respond_with @comment | |
end | |
end | |
class CommentCreator | |
def initialize(comment) |
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 CommentsController | |
def create | |
@comment = Comment.create(params[:comment]) | |
CommentCreatedWorker.perform_async(@comment.id) | |
respond_with @comment | |
end | |
end | |
class CommentCreatedWorker | |
include Sidekiq::Worker |
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 CommentsController | |
def create | |
@comment = Comment.create(params[:comment]) | |
if @comment.previous_comment? | |
reply_to_user = comment.previous_comment.author | |
CommentCreatedWorker.perform_async(@comment.id, reply_to_user.id) | |
end | |
respond_with @comment | |
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
# Steps to implement: | |
# 1. Ensure you're using >= coffeescript-1.6.1 | |
# | |
# 2. Put this file in an initializer. | |
# | |
# 3. Edit an environment's config to turn on source maps: | |
# | |
# `config.assets.sourcemaps = true` | |
# | |
# 4. Add /public/sourcemaps to your .gitignore |
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
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |