Persyaratan perpanjangan SIM C, tes psikotes jalan gunung Sanghyang seberang pohon besar 90, surat keterangan sehat cari di Gunung Guntur 25.
FROM bitnami/ruby:2.6.3 | |
ARG DEBIAN_VERSION="stretch" | |
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | \ | |
tee /etc/apt/sources.list.d/yarn.list && \ | |
echo "deb http://packages.cloud.google.com/apt cloud-sdk-$DEBIAN_VERSION main" | \ | |
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ |
# Exponential backoff in Ruby | |
begin | |
make_request | |
rescue RequestError => e | |
if retries <= max_retries | |
retries += 1 | |
sleep 2 ** retries | |
retry | |
else | |
raise "Timeout: #{e.message}" |
class Array | |
def my_map | |
self.reduce([]) do |new_array, element| | |
new_array.push(yield(element)) | |
end | |
end | |
end | |
[1, 2, 3].my_map { |x| x * 2 } | |
#=> [2, 4, 6] |
# Put this script in ~/.password-store alongside import.csv | |
# This script requires the CSV to have these columns: | |
# `title`, `username`, `password`, `additional_secret` | |
require "csv" | |
require "fileutils" | |
require "gpgme" # gem install gpgme | |
gpg_recipients = "[email protected]" |
# This Dockerfile for a Ruby application was generated by gcloud. | |
# The base Dockerfile installs: | |
# * A number of packages needed by the Ruby runtime and by gems | |
# commonly used in Ruby web apps (such as libsqlite3) | |
# * A recent version of NodeJS | |
# * A recent version of the standard Ruby runtime to use by default | |
# * The bundler gem | |
FROM gcr.io/google-appengine/ruby:latest |
# We have to remove validations on email, as it's no longer needed. | |
# Based on a solution found at http://stackoverflow.com/questions/7545938/how-to-remove-validation-using-instance-eval-clause-in-rails | |
Model.class_eval do | |
_validators.reject!{ |key, _| key == :field } | |
_validate_callbacks.each do |callback| | |
callback.raw_filter.attributes.delete :field | |
end |
[Install] | |
WantedBy=multi-user.target | |
[Unit] | |
Description=Google Cloud Compute Engine SQL Proxy | |
Requires=networking.service | |
After=networking.service | |
[Service] | |
Type=simple |
Optimistic Locking assumes that a database transaction conflict is very rare to happen. It uses a version number of the record to track the changes. It raise an error when other user tries to update the record while it is lock.
usage
Just add a lock_version column to the table you want to place the lock and Rails will automatically check this column before updating the record.
Pessimistic locking assumes that database transaction conflict is very likely to happen. It locks the record until the transaction is done. If the record is currently lock and the other user make a transaction, that second transaction will wait until the lock in first transaction is release.
usage
If you're running a Rails app in Google App Engine's flexible environment, it takes a bit of setup to get to a rails console attached to your deployed environment. I wanted to document the steps for my own reference and also as an aid to others.
-
Open the Google App Engine -> instances section of the Google Cloud Platform (GCP) console.
-
Select the "SSH" drop-down for a running instance. (Which instance? Both of my instances are in the same cluster, and both are running Rails, so it didn't matter for me. YMMV.) You have a choice about how to connect via ssh.
-
Choose "Open in browser window" to open a web-based SSH session, which is convenient but potentially awkward.
-
Choose "View
gcloud
command" to view and copy agcloud
command that you can use from a terminal, which lets you use your favorite terminal app but may require the extra steps of installing thegcloud
command and authenticating thegcloud
command with GCP.
-