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
<!DOCTYPE html> | |
<!-- | |
High Res Theme 1.1.9 -- 26 September 2012 | |
(c) 2011-2012 Justin Ouellette, all rights reserved | |
http://highrestheme.tumblr.com/ | |
--> | |
<html> | |
<head> | |
<title>{Title}{block:PostSummary} - {PostSummary}{/block:PostSummary}</title> | |
<meta name="tumblr-theme" content="30257" /> |
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 AppController extends Controller { | |
function beforeFilter() { | |
$this->capture_request_head_for_log(); | |
} | |
/* | |
Log some basic basic details of the HTTP Request: | |
Started GET "/users/lost" for 127.0.0.1 at 2012-10-24 19:18:25 -0700 |
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
// Generate the timestamp for the filename from the command line like: | |
// php -r "echo date('YmdHis', time());" | |
UP | |
-- | |
CREATE TABLE foo ( | |
id int(11) PRIMARY KEY AUTO_INCREMENT, | |
first_name varchar(64) | |
); |
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
create_table :media_items do |t| | |
t.string :type, :null => false, :limit => 32 | |
t.string :name | |
t.timestamps | |
end | |
class MediaItem < ActiveRecord::Base | |
validates_presence_of :kind | |
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
#import "Account.h" | |
#import "JSONKit.h" | |
@implementation Account | |
@synthesize name = _name; | |
@synthesize accountId = _accountId; | |
@synthesize initial = _initial; | |
@synthesize code = _code; |
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
SELECT varietals.*, ts_rank_cd(varietals.search_content, plainto_tsquery('vinosmith', 'gruner')) as rank | |
FROM varietals WHERE varietals.search_content @@ plainto_tsquery('vinosmith', 'gruner') | |
ORDER BY rank DESC limit 25 | |
=> [#<Varietal id: 657, name: "Grüner Veltliner" .. ] |
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
CREATE EXTENSION unaccent; | |
CREATE TEXT SEARCH CONFIGURATION vinosmith ( COPY = english ); | |
ALTER TEXT SEARCH CONFIGURATION vinosmith ALTER MAPPING FOR hword, hword_part, word WITH unaccent, english_stem; | |
CREATE TRIGGER contacts_search_content_trigger BEFORE INSERT OR UPDATE | |
ON contacts FOR EACH ROW EXECUTE PROCEDURE | |
tsvector_update_trigger(search_content, 'public.vinosmith', title, name, phone, fax, email, mobile_phone); | |
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
2012-04-27T21:10:44Z 530 TID-owb1ckq7w INFO: Booting sidekiq 1.1.4 with Redis at redis://localhost:6379/6 | |
2012-04-27T21:10:44Z 530 TID-owb1ckq7w INFO: Running in ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0] | |
2012-04-27T21:10:44Z 530 TID-owb1ckq7w DEBUG: {:queues=>["default"], :concurrency=>25, :require=>".", :environment=>"development", :timeout=>8, :enable_rails_extensions=>true} | |
2012-04-27T21:10:44Z 530 TID-owb099rks INFO: Starting processing, hit Ctrl-C to stop | |
2012-04-27T21:10:59Z 530 TID-owb14h9wk INFO: IntuitSyncRequest MSG-owb14ha9w start | |
/Users/codyc/.rvm/gems/ruby-1.9.3-p194@vino/gems/activerecord-3.2.2/lib/active_record/result.rb:30: [BUG] Segmentation fault | |
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0] | |
-- Control frame information ----------------------------------------------- |
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
SELECT contacts.*, ts_rank_cd(contacts.search_content, to_tsquery('purple & drank')) as rank | |
FROM contacts | |
WHERE contacts.search_content @@ to_tsquery('purple & drank') | |
ORDER BY rank DESC | |
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
CREATE FUNCTION wine_books_search_content_trigger() RETURNS trigger AS $$ | |
begin | |
new.search_content := ( | |
-- MUST use COALLESCE here if any of these columns can be NULL | |
SELECT to_tsvector(COALESCE(wine_books.code, '') || ' ' || COALESCE(wine_books.name, '') || ' ' || COALESCE(producers.name, '') || ' ' || COALESCE(varietals.name, '') || COALESCE(wine_books.year::varchar, '')) | |
FROM wine_books | |
LEFT OUTER JOIN producers ON producers.id = wine_books.producer_id | |
LEFT OUTER JOIN varietals ON varietals.id = wine_books.varietal_id | |
WHERE wine_books.id = new.id); | |
return new; |