The following is the configuration setup for
- Rails 8
- Kamal 2
- VPS Ubuntu 24.04 LTS
- PostgreSQL
- Redis
- SSL
| class Plateau | |
| attr_accessor :max_x, :max_y, :direction | |
| def initialize(x, y, direction = :n) | |
| @max_x = x.to_i | |
| @max_y = y.to_i | |
| @direction = direction.downcase.to_sym | |
| end | |
| def land(position) |
| class Plateau | |
| attr_accessor :max_x, :max_y, :direction | |
| def initialize(x, y, direction = :n) | |
| @max_x = x.to_i | |
| @max_y = y.to_i | |
| @direction = direction.downcase.to_sym | |
| end | |
| end |
| class Array | |
| def flattener | |
| arr = [] | |
| self.each do |x| | |
| if x.is_a? Array | |
| arr = arr + x.flattener | |
| else | |
| arr << x | |
| end |
| date = ARGV[0] | |
| class Date | |
| def self.valid?(date) | |
| y, m, d = date.split '-' | |
| date.match(/^\d{4}-\d{2}-\d{2}$/) && Date.valid_date?(y.to_i, m.to_i, d.to_i) | |
| end | |
| end | |
| require 'hexapdf' | |
| class ShowTextProcessor < HexaPDF::Content::Processor | |
| def initialize(page) | |
| super() | |
| @canvas = page.canvas(type: :overlay) | |
| end | |
| def show_text(str) |
| require 'hexapdf' | |
| doc = HexaPDF::Document.open("/home/xxxx/Downloads/OoPdfFormExample.pdf") | |
| page = doc.pages[0] | |
| canvas = page.canvas(type: :overlay) | |
| canvas.translate(0, 20) do | |
| canvas.fill_color(0.3, 0.7, 0.7) | |
| canvas.rectangle(50, 0, 80, 80, radius: 80) |
Today I had a task to take backup of database and upload to S3. Taking the backup to local machine was straight forward job. Uploading to S3 with fog-aws gem was time consuming due to lack of documentation. May be this article may help you with Uploading file to S3 with fog. Since the application is already using fog-aws gem, I preferred to use the same gem over aws-sdk.
Make sure Gemfile has
gem 'fog-aws'
Configured ElasticSearch with Neo4j as per demo app Search results are not as expected. Search results of ElasticSearch are different with Neo4j.
After starting and configuring ElasticSearch and Neo4j
Add the following data to Neo4j DB at http://0.0.0.0:7474/browser/
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="com.cards.notification"> | |
| <uses-sdk | |
| android:minSdkVersion="17" | |
| android:targetSdkVersion="17" /> | |
| <application | |
| android:allowBackup="true" |