- most of my new code is on bitbucket
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 'spec/spec_helper' | |
| describe "ThinkingSphinx::ActiveRecord (testing total entries results) " do | |
| before :all do | |
| @sphinx.setup_sphinx | |
| @sphinx.start | |
| end | |
| after :all do |
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
| $strace zmq_server 5672 | |
| execve("/usr/local/bin/zmq_server", ["zmq_server", "5672"], [/* 36 vars */]) = 0 | |
| brk(0) = 0x8672000 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb800b000 | |
| access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| open("/etc/ld.so.cache", O_RDONLY) = 3 | |
| fstat64(3, {st_mode=S_IFREG|0644, st_size=61344, ...}) = 0 | |
| mmap2(NULL, 61344, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ffc000 | |
| close(3) = 0 |
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
| laptop: | |
| Rehearsal ---------------------------------------------- | |
| With GC 0.700000 0.020000 0.720000 ( 1.179962) | |
| Without GC 0.090000 0.030000 0.120000 ( 0.516162) | |
| ------------------------------------- total: 0.840000sec | |
| user system total real | |
| With GC 0.660000 0.000000 0.660000 ( 1.169336) | |
| Without GC 0.120000 0.020000 0.140000 ( 0.474433) |
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
| diff --git a/spec/fixtures/data.sql b/spec/fixtures/data.sql | |
| index 3baaf35..a1ead87 100644 | |
| --- a/spec/fixtures/data.sql | |
| +++ b/spec/fixtures/data.sql | |
| @@ -1023,3 +1023,7 @@ insert into `animals` (name, type) values ('nat', 'Cat'); | |
| insert into `animals` (name, type) values ('molly', 'Cat'); | |
| insert into `animals` (name, type) values ('jasper', 'Cat'); | |
| insert into `animals` (name, type) values ('moggy', 'Cat'); | |
| +insert into `cities` (name, zip) values ('Jackson', 49201); | |
| +insert into `cities` (name, zip) values ('Rives.', 49201); |
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.without_updates_and_deltas | |
| de, ue = @@deltas_enabled, @@updates_enabled | |
| @@deltas_enabled = @@updates_enabled = false | |
| yield | |
| @@deltas_enabled, @@updates_enabled = de, ue | |
| 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
| >> r.send(:index_delta) | |
| Sphinx 0.9.8-release (r1371) | |
| Copyright (c) 2001-2008, Andrew Aksyonoff | |
| using config file '/home/mmmurf/hellocreature/config/development.sphinx.conf'... | |
| indexing index 'recipient_delta'... | |
| collected 9999 docs, 0.3 MB | |
| collected 0 attr values | |
| sorted 0.0 Mvalues, 100.0% done | |
| sorted 0.0 Mhits, 100.0% done |
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
| module RiddleLogger | |
| def self.included(base) | |
| base.send :include, InstanceMethods | |
| base.alias_method_chain :query_message, :logging | |
| end | |
| module InstanceMethods | |
| def query_message_with_logging(search, index, comments = '') |
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
| <h1>This is a page with a report on it:</h1> | |
| <h2>Long Running Report</h2> | |
| <% future_cache("long running report for user #{current_user.id}", {:ttl => 1.day, :callback => current_user.deliver_report_finished_email}) do %> | |
| <% render :partial => 'report', :collection => current_user.reports.big %> | |
| <% else %> | |
| <strong> This report is being generated, you will receive an email when it's complete</strong> | |
| <% 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
| caches_action :show => { :ttl => 10.minutes, :if => Proc.new {|c| c.current_user.nil? || !c.current_user.logged_in?} } | |
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
| em httpclient | |
| POST /messages/create HTTP/1.1 | |
| Content-length: 125 | |
| Host: localhost:3333 | |
| Authorization: Basic cGVuZ3VpbjpwbTMwMDI= | |
| User-agent: Ruby EventMachine | |
| Content-type: application/x-www-form-urlencoded | |
| firefox |