echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`
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
# https://medium.com/rubyinside/asynchronous-elasticsearch-bulk-reindexing-with-rails-searchkick-and-sidekiq-26f2f9aa8513 | |
# https://github.com/ankane/searchkick | |
# 2.3.2 [unreleased] | |
# - Added wait option to async reindex | |
# Searchkick.reindex(async: {wait: true}) | |
# This code has been ported to searchkick. | |
require 'sidekiq/api' | |
# BulkReindexer | |
module BulkReindexer |
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
namespace :staging do | |
desc 'create subdomain DNS record for Heroku review app' | |
task :publish_dns do | |
require 'dnsimple' | |
require 'platform-api' | |
STAGING_DOMAIN = 'mystagingdomain.com'.freeze | |
DNSIMPLE_ACCOUNT_ID = .freeze | |
heroku_app_name = ENV['HEROKU_APP_NAME'] | |
subdomain = heroku_app_name.match(/.*(pr-\d+)/).captures.first |
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 | |
# | |
# This script will make a webcam snapshot every commit. The jpg file will have | |
# the commit id as the filename. | |
# | |
# This script requires imagesnap. Install with: 'brew install imagesnap' | |
# | |
# Put this file in the '.git/hooks/' name it 'post-commit' and chmod it by: | |
# 'chmod +x .git/hooks/post-commit' | |
# |
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
# blog post: http://blog.slashpoundbang.com/post/2613268281/changing-from-tz-database-identifiers-to-rails-friendly | |
{ | |
"Australia/Adelaide" => "Adelaide", | |
"Australia/Broken_Hill" => "Adelaide", | |
"America/Anchorage" => "Alaska", | |
"America/Juneau" => "Alaska", | |
"America/Nome" => "Alaska", | |
"America/Yakutat" => "Alaska", | |
"Pacific/Gambier" => "Alaska", | |
"Asia/Almaty" => "Almaty", |
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
# -*- coding: utf-8 -*- | |
""" | |
Zendesk timezones are represented by friendly names that map to tz database names. | |
For example, an API request returns "Eastern Time (US & Canada)" instead of "America/New_York". | |
You can map the friendly names to the tz database names by referencing the Constants > Mapping | |
section of the Ruby on Rails TimeZone object doc. | |
https://developer.zendesk.com/rest_api/docs/core/users#time-zone |
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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
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
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'selenium-webdriver', '3.142.3' | |
gem 'webdrivers' | |
gem 'capybara', '3.28.0' | |
gem 'byebug' | |
end |
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
# spec/support/capybara.rb | |
require 'capybara/rails' | |
require 'capybara/rspec' | |
# port and url to webpack server | |
WEB_TEST_PORT = '5005'.freeze | |
WEB_TEST_URL = "http://localhost:#{WEB_TEST_PORT}".freeze | |
def capybara_wait_for_webpack_server | |
10.times.each do |_| |
NewerOlder