This file contains hidden or 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
| --- | |
| - name: Update APT | |
| action: apt update-cache=yes | |
| tags: | |
| - install | |
| ignore_errors: True |
This file contains hidden or 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
| # This creates a deb package called macdeb-ruby-1.9.3-p125_x86_64.deb | |
| # | |
| # You can then install it (including dependencies) using gdebi | |
| # `sudo gdebi macdeb-ruby-1.9.3-p125_x86_64.deb` | |
| # | |
| # To install gdebi, run `sudo aptitude install gdebi-core` | |
| macdeb create --formula ruby --namespace macdeb --pkgname ruby --pkgver 1.9.3-p125 |
This file contains hidden or 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 self.leaderboard | |
| Hero.select("id, login, name, location, votes_received, avatar_url, html_url, rank() over(order by votes_received DESC)").limit(20) | |
| end |
This file contains hidden or 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 set_asset_fingerprint! | |
| # -- First see if the files have changed | |
| puts "-----> Calculating Asset Fingerprint" | |
| fingerprint_method = "find public -type f -exec md5 {} + | awk '{print $0}' | sort | md5" | |
| current_fingerprint = %x{#{fingerprint_method}} | |
| fingerprint_file = Rails.root.join('assets.fingerprint') | |
| if !File.exists?(fingerprint_file) || current_fingerprint != File.read(fingerprint_file) | |
| execute("#{fingerprint_method} > #{fingerprint_file}") | |
| # -- Add it to production |
This file contains hidden or 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
| require File.expand_path('../boot', __FILE__) | |
| require 'rails/all' | |
| # If you have a Gemfile, require the gems listed there, including any gems | |
| # you've limited to :test, :development, or :production. | |
| Bundler.require(:default, Rails.env) if defined?(Bundler) | |
| module GetDenso | |
| class Application < Rails::Application |
This file contains hidden or 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
| CREATE INDEX desc_created_citems_idx on channel_items(created_at DESC NULLS LAST); |
This file contains hidden or 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
| Channel.transaction do | |
| @channel.save | |
| rss_bot = @channel.build_youtube_rss_bot(:username => youtube_username) | |
| if rss_bot.valid? | |
| rss_bot.save | |
| Delayed::Job.enqueue(SocialFeed::YoutubeRssScraper.new(rss_bot)) | |
| else | |
| @channel.errors.add(:youtube_username, rss_bot.errors[:username]) |
This file contains hidden or 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
| %ul | |
| - @feed_stories.each do |story| | |
| %li= render :partial => 'feed_item', :locals => { :s => story } | |
| = will_paginate @feed_stories |
This file contains hidden or 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
| describe('pusher', function() { | |
| describe('message event', function() { | |
| it("should append the message to the timeline", function() { | |
| spyOn(room, 'appendMessage'); | |
| spec.loadFixture('room-show'); | |
| room.pusher.send_local_event('message', messageStub('abc-def-ced'), room.room_id); | |
| expect(room.appendMessage).toHaveBeenCalled(); | |
| }); | |
| }); | |
| }); |
This file contains hidden or 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
| ab -n 1000 -c 1000 http://0.0.0.0:3000/ |