Follow this pyenv/pyenv#1740 (comment)
Adds machine's external ip address to gcloud sql instance's whitelisted ip list.
- Generate service account json file as mentioned in gcloud authentication guide. https://github.com/googleapis/google-cloud-common/tree/master/authentication
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
dig +short myip.opendns.com @resolver1.opendns.com |
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 -ex | |
echo "stop running resque processes" | |
pidfile_sched="tmp/pids/resque_scheduler.pid" | |
if [ -e $pidfile_sched ] ; then | |
scheduler_pid=$(cat $pidfile_sched) | |
echo "scheduler_pid: $scheduler_pid" | |
if [ -z $scheduler_pid ] ; then | |
echo "No PID found for resque scheduler" |
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
# Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# | |
# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. | |
# A copy of the License is located at | |
# | |
# http://aws.amazon.com/asl/ | |
# | |
# or in the "license" file accompanying this file. | |
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. | |
# See the License for the specific language governing permissions and limitations under the License. |
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
# This is a sample build configuration for Ruby. | |
# Check our guides at https://confluence.atlassian.com/x/8r-5Mw for more examples. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
image: ruby:2.4.1 | |
pipelines: | |
default: | |
- step: |
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
# frozen_string_literal: true | |
# Module maps filter parameters to filers | |
# class SomeClass < ApplicationRecord | |
# include Filterable | |
# ... | |
# scope :scope_name, ->(arg) { where(x: arg) } | |
# scope :another_scope, -> { where(b: :c) } | |
# available_filters param_key: { scope: :scope_name, args_needed: true } | |
# param_key2: { scope: another_scope } |
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
# frozen_string_literal: true | |
# lib/paperclip/cloudfront_signed_url_extension | |
module Paperclip | |
module CloudfrontSignedUrlExtension | |
include UriValidationHelper | |
def cloudfront_signed_url(time = nil, style_name = default_style, options = {}) | |
return url(style_name, options) unless valid_url?(url(style_name)) |
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
# lib/generators/service/USAGE | |
Description: | |
Generates Service Class | |
Example: | |
rails generate service Thing | |
This will create: | |
app/services/thing.rb |
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 | |
# | |
# Author: Robert R Evans | |
# | |
# Description: AWS Ubuntu 13 Ruby Setup Script | |
# | |
# This script will setup a ubuntu box for Ruby, Rails, Sinatra, and/or Rack | |
# development/staging/production usage. It also installs Nodejs, Nginx, Git, | |
# Rbenv, and PostgreSQL adapters for using RDMS PostgreSQL. It assumes that | |
# git-deploy will be used, in place of the traditional capistrano deployments. |
NewerOlder