Skip to content

Instantly share code, notes, and snippets.

View nglx's full-sized avatar
✌️
no mud no lotus

marcin naglik nglx

✌️
no mud no lotus
View GitHub Profile
module Scope
def self.included(base)
base.has_scope :with_name_like
base.has_scope :with_title_like
end
end
class PostsController < ApplicationController
include Scope
ActiveRecord.where('created_at > ?', Time.now).to_sql
@nglx
nglx / gist:3787676
Created September 26, 2012 12:15 — forked from bjallen/gist:3723463
city impact on results
# see what the confidence code means here:
# http://www.mapquestapi.com/geocoding/geocodequality.html
Web::Address.from_params({ :street => "Canal Road", :city => "Orleans", :state => "MA", :country => "US" })
[{"country_name"=>"United States",
"city"=>"Orleans",
"@name"=>"location",
"latitude"=>41.796795,
"country"=>"US",
@nglx
nglx / gist:1364123
Created November 14, 2011 15:06
test
-- fdsafdas
- fasdfdsa
fdasfdas