Skip to content

Instantly share code, notes, and snippets.

@notch8-old
notch8-old / spec_fail.rb
Created February 7, 2011 03:12
Failing Gangaroo Spesc
(in /Users/rob/work/gangaroo/gangaroo)
AssociationsController
on GET to index
(FAILED - 1)
on GET to show
(FAILED - 2)
on GET to new
(FAILED - 3)
on POST to create
unless params[:q].blank?
clean_request_uri_for(params[:q])
@query = params[:q]
else
if params[:q]
redirect_to request.path and return
end
end
@notch8-old
notch8-old / gist:730749
Created December 6, 2010 19:08
solr issues
def index
unless params[:q].blank?
clean_request_uri_for(params[:q])
@query = params[:q]
else
if params[:q]
redirect_to request.path and return
end
end
code = params['code'] # Facebooks verification string
begin
access_token_hash = MiniFB.oauth_access_token(FB_APP_ID, facebook_oauth_url(@campaign), FB_SECRET, code)
@facebook_access_token = access_token_hash["access_token"]
# TODO: This is where you'd want to store the token in your database
# but for now, we'll just keep it in the cookie so we don't need a database
cookies[:facebook_access_token] = @facebook_access_token
@facebook_user = MiniFB.get(@facebook_access_token, "me", :metadata=>true)
@accounts = [{"id" => @facebook_user["id"], "name" => @facebook_user["name"], "kind" => "user"}]
dig www.lajollakayak.com
; <<>> DiG 9.6.0-APPLE-P2 <<>> www.lajollakayak.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33163
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.lajollakayak.com. IN A
def next_meeting(now=1.day.from_now)
if Chronic.parse("1st thursday of this month", :context => :past, :now => now)
return Chronic.parse('1st thursday of next month', :now => now)
else
return Chronic.parse("1st thursday of this month", :now => now)
end
end
target = Chronic.parse('1st thursday this month')
if Time.now > target
return Chronic.parse('1st thursday of next month')
else
return target
end
def permitted_wares(published = true, page = 1, per_page = 20, provider_name=nil)
if self.is_admin? && provider_name.nil?
Ware.all.paginate(:page => page, :per_page => per_page)
else
total_amount = 0
user_providers = provider_name.nil? ? self.providers : [provider_name]
store = PrivateMarketplace.enabled? ? PrivateMarketplace.name : "depot-store"
keys = user_providers.map { |provider| [provider, store] }
if published
2010-04-29 13:40 $ dig @ns2.mediatemple.net tc.rothschilddownes.com
; <<>> DiG 9.6.0-APPLE-P2 <<>> @ns2.mediatemple.net tc.rothschilddownes.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3538
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
require 'fileutils'
#File selection logic
def run(command)
puts command
`#{command}`
end
old_file_name = "twitter-stencil.zip"
new_file_name = "twitter-stencil"