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
Table schema for locations: | |
=========================== | |
create_table "locations", :force => true do |t| | |
t.string "zipcode", :limit => 6 | |
t.string "city", :limit => 25 | |
t.string "state_code", :limit => 3 | |
t.string "state_name", :limit => 25 | |
t.float "latitude" | |
t.float "longitude" |
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
# Below is a snippet to generate sitemap.xml file | |
# Reference: http://www.sitemaps.org, http://en.wikipedia.org/wiki/Site_map, http://support.google.com/webmasters/bin/answer.py?hl=en&answer=183668&topic=8476&ctx=topic | |
xml.instruct! | |
xml.urlset(:xmlns => "http://www.sitemaps.org/schemas/sitemap/0.9") { | |
@items.each do |item| | |
xml.url { | |
xml.loc(item_url(item)) |
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
# Location: /Capfile | |
load 'deploy' | |
# Uncomment if you are using Rails' asset pipeline | |
load 'deploy/assets' | |
load 'config/deploy' # remove this line to skip loading any of the default tasks |
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
# Location: config/initializers/app_config.rb | |
APP_CONFIG = YAML.load_file(File.join(Rails.root, 'config', 'config.yml'))[Rails.env] |
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
#!/bin/bash | |
### Setup a wifi Access Point on Ubuntu 12.04 (or its derivatives). | |
### make sure that this script is executed from root | |
if [ $(whoami) != 'root' ] | |
then | |
echo " | |
This script should be executed as root or with sudo: | |
sudo $0 | |
" |
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
#!/usr/bin/env bash | |
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
# Versions | |
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` |
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
# Location: app/controllers/api/base_controller.rb | |
class Api::BaseController < ApplicationController | |
rescue_from ::Exception, :with => :rescue_exception | |
rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found | |
rescue_from ActionController::RoutingError, :with => :routing_error | |
def undefined_route | |
routing_error | |
end |