###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
[Unit] | |
Description=Puma Rails Server | |
After=network.target | |
[Service] | |
Type=simple | |
User=deploy | |
WorkingDirectory=/home/deploy/app/current | |
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb | |
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop |
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
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 a gcloud
command that you can use from a terminal, which lets you use your favorite terminal app but may require the extra steps of installing the gcloud
command and authenticating the gcloud
command with GCP.
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
[Install] | |
WantedBy=multi-user.target | |
[Unit] | |
Description=Google Cloud Compute Engine SQL Proxy | |
Requires=networking.service | |
After=networking.service | |
[Service] | |
Type=simple |
# 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 |
Persyaratan perpanjangan SIM C, tes psikotes jalan gunung Sanghyang seberang pohon besar 90, surat keterangan sehat cari di Gunung Guntur 25.
# 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 |
# 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 = "hello@ukazap.space" |
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] |