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
| /** | |
| * Author: Richard Willis - badsyntax.co | |
| * Example here: http://demos.badsyntax.co/places-search-bootstrap/example.html | |
| * | |
| * Please note: This is not a reliable method of geocoding the address. Using the | |
| * PlacesService is a much better approach. View the example above for an example | |
| * of using the PlacesService to geocode the address. | |
| */ | |
| var service = new google.maps.places.AutocompleteService(); |
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
| class PostsController < ActionController::Base | |
| def create | |
| Post.create(post_params) | |
| end | |
| def update | |
| Post.find(params[:id]).update_attributes!(post_params) | |
| end | |
| private |
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 Mongo | |
| module Instrumentation | |
| def self.instrument(clazz, *methods) | |
| clazz.module_eval do | |
| methods.each do |m| | |
| class_eval %{def #{m}_with_instrumentation(*args, &block) | |
| ActiveSupport::Notifications.instrumenter.instrument "mongo.mongo", :name => "#{m}" do | |
| #{m}_without_instrumentation(*args, &block) | |
| end | |
| 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
| # geo.rb | |
| # Formulas from | |
| # | |
| # haversine formula to compute the great circle distance between two points given their latitude and longitudes | |
| # | |
| # Copyright (C) 2008, 360VL, Inc | |
| # Copyright (C) 2008, Landon Cox | |
| # | |
| # http://www.esawdust.com (Landon Cox) |
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 Devise | |
| module Models | |
| module Confirmable | |
| handle_asynchronously :send_confirmation_instructions | |
| end | |
| module Recoverable | |
| handle_asynchronously :send_reset_password_instructions | |
| 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
| require 'rack/utils' | |
| module Rack | |
| # | |
| # EnforceSSL is a Rack middleware app that enforces that users visit | |
| # specific paths via HTTPS. If a sensitive path is requested over | |
| # plain-text HTTP, a 307 Redirect will be issued leading to the HTTPS | |
| # version of the Requested URI. | |
| # | |
| # MIT License - Hal Brodigan (postmodern.mod3 at gmail.com) |