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
# WebPage uses cache??? What the heck is cache in context of a webpage crawling process? It should only crawl pages. You need to inject some dummy cache to prevent caching. | |
# thumnail generation is an expensive job, thus lazy-loading. But you are not saving already generated thumbnails in cache. :( | |
# Nice tests. |
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
================================================================================ | |
["RestClient", 5.152005974] | |
-------------------------------------------------------------------------------- | |
["Curb", 2.073422755] | |
-------------------------------------------------------------------------------- | |
["Thrift", 3.357725494] | |
-------------------------------------------------------------------------------- |
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
bus = On::Bus.new. | |
subscribe(DonationReceipt). | |
subscribe(NotifyAccountingSystem). | |
subscribe(UpdatePublicStats). | |
subscribe(LogInternalMetrics). | |
subscribe(UpdateAnalyticsDashboard). | |
subscribe(RealtimeViewerUpdate) |
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 link_to_notifiable(notifiable) | |
notifiable.link_to_notifiable(self) | |
end | |
# concerns/notifiable_presenters.rb | |
class Answer | |
def link_to_notifiable(helper) | |
helper.link_to_answer, question | |
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 InviteController < ApplicationController | |
# The controller's responsibility is to build an object graph | |
# that will do the hard work. | |
def accept | |
scenario = InvitationScenario.new | |
scenario.accept_invite_token_for_user(current_user, params[:token], bus.when( | |
inviting_succeeded: ->(user) { redirect_to invite.item, notice: "Welcome!" }, | |
inviting_failed: ->(error) { redirect_to '/', alert: "Oopsy!" } | |
)) |
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
#!/bin/bash | |
VERSION="1.1.1" | |
PORT="9333" | |
PWD=`pwd` | |
mkdir -p ~/elasticsearch/ | |
cd ~/elasticsearch/ | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${VERSION}.zip |