Skip to content

Instantly share code, notes, and snippets.

View scoop's full-sized avatar

Patrick Lenz scoop

View GitHub Profile

Keybase proof

I hereby claim:

  • I am scoop on github.
  • I am patricklenz (https://keybase.io/patricklenz) on keybase.
  • I have a public key whose fingerprint is E1E7 1F93 B11A A43B 1CD9 ED2A E8FE EB54 2F89 CDBB

To claim this, I am signing this object:

@scoop
scoop / amazon-suggest-germany.php
Created April 6, 2013 07:59
Modified example Gist for Alfred 2 to use Amazon Suggest for Amazon.de (instead of the default Amazon.com). Note: Remove `<?php .. ?>`, which I only added for syntax highlighting purposes.
<?php
require('workflows.php');
$w = new Workflows();
// Grab input and build query url string
$in = "{query}";
$url = "http://completion.amazon.co.uk/search/complete?method=completion&q=".urlencode( $in )."&search-alias=aps&mkt=4&x=updateISSCompletion&noCacheIE=1295031912518";
// Grab the data from Amazon
$str = $w->request( $url );
From: "Amazon.co.uk" <order-update@amazon.co.uk>
To: <patrick@xxx>
Cc: "order-update@amazon.co.uk" <order-update@amazon.co.uk>
Subject: Important Information regarding Your Amazon.co.uk Order
Dear Customer,
We have been made aware of a manufacturing issue with a title you recently purchased from Amazon.co.uk:
-----------------------------------------------------
@scoop
scoop / runner.rb
Created August 24, 2010 11:58 — forked from pcreux/runner.rb
#!/usr/bin/env ruby
# script/runner for rails 3.0.0.rc2
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands/runner'
/* Import from central server */
@import url("http://stevenf.com/pages/shutup/shutup-1.1.css");
/* Re-enable Slashdot comments */
#commentlisting {
display: block !important;
}
class Project < ActiveRecord::Base
define_index do
indexes :name
indexes :description
has tags(:id), :as => :tag_ids
end
end
Project.faceted_search :group_by => :tag_ids
# => { #<Tag id: 1, name: "foo"> => 1, #<Tag id: 2, name: "bar"> => 3 }
diff --git a/lib/cash/query/abstract.rb b/lib/cash/query/abstract.rb
index 2452200..48a3476 100644
--- a/lib/cash/query/abstract.rb
+++ b/lib/cash/query/abstract.rb
@@ -1,7 +1,7 @@
module Cash
module Query
class Abstract
- delegate :with_exclusive_scope, :get, :table_name, :indices, :find_from_ids_without_cache, :cache_key, :to => :@active_record
+ delegate :with_exclusive_scope, :get, :table_name, :indices, :find_from_ids_without_cache, :cache_key, :columns_hash, :to => :@active_record