Dart programming is a language optimized for building user interfaces used in the Flutter mobile framework. It combines the world of OOP and functional. I am a big fan of functional programming, One of the problems in Dart I found boring and inconvenient is to write the built-in List#map API. The List#map passes each element of the list to the callback without the index of the element. The full method signature looks like this:

Iterable map(f(E element));

This is perfectly fine for some cases. …


class ShipmentItem < ApplicationRecord  has_one_attached :image  validates :width, presence: true, if: ->(item) { !item.image.attached?}end
it 'is valid if image is attached' do file = Rails.root.join('spec', 'support', 'assets', 'shipment_item', 'wine-box.jpeg')image = ActiveStorage::Blob.create_after_upload!( io: File.open(file, 'rb'), filename: 'wine-box.jpeg', content_type: 'image/jpeg' # Or figure it out from `name` if you have non-JPEGs).signed_id shipment_item = ShipmentItem.new(image: image) expect(shipment_item.valid?).to eq trueend


From time to time I have this warning

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4

Now I can inspect

gem list bundler

The result show bundler 2.1.2 is the default. The default is the one that will be used.

Even you try to install bundler 2.1.4

gem install bunder:2.1.4 # or even with the --default

As default gems are not allowed to be uninstalled, I found this ruby code from https://github.com/rubygems/bundler/issues/7107#issuecomment-572296292

File.join Gem.default_specifications_dir


Building a non-refresh web app with a desktop-like experience is not that hard, you just need a right tool.

Introduction

Vuejs is a great javascript framework, but building a full functionality web app is not easy. It lacks an architectural structure and its router generates a lot of boilerplate code. This is how Nuxtjs comes into play. NuxtJs is an easy to learn, progressive and high-performance framework that can be used for:

  • Static content webpages: Create static pages easily. Share partials, footers, headers, and sidebars like a pro.
  • Server-side rendering: Render your content on the server-side, SEO friendly, encapsulate business logic…

The new macOS Catalina 10.15 with default openssl@1.1 build failed.

use the following to install it.

RUBY_CONFIGURE_OPTS=”-with-openssl-dir=/usr/local/opt/openssl” rbenv install 2.3.1

gem libv8 issue in macOS 10.15 Catalina

Install libv8 v=6.7.288.46.1 get stuck with macOS Catalina. Update mini_racer to depend on the libv8 version greater than 7.x.x.

I had gem ‘mini_racer’, ‘~> 0.2.4’ which depends on libv8(6.7.288.46.1).

# Gemfile
gem 'mini_racer', '~> 0.2.6'

and then run bundle update mini_racer to force libv8 dependency to the version greater than 6.x.x.

Fetching libv8 7.3.492.27.1 (x86_64-darwin-19) (was 6.7.288.46.1)
Installing libv8 7.3.492.27.1 (x86_64-darwin-19) (was 6.7.288.46.1)

gem mysql2 in macOS Catalina

brew install mysql@5.7
brew install mysql-client@5.7

If you have an OpenSSL issue, try this

#double check if…


Docker is a great tool to isolation your env from the host machine. You can consider Docker as a virtual machine like VMWare or VirtualBox but with a much lighter and more friendly and flexible.

This blog is dedicated for Ruby on Rails apps, but you might find it usually for other technologies as well since Docker and AWS ECS are technologies independent.

So why docker for your app?

Isolate environment: This is very challenging. Imagine your computer is a MacBook Pro but your app is RubyonRails requires to run on Ubuntu Server. Without Docker will need to install libs on the host OS, every update…


I’ve been through some of the problems that were hard enough for me that I was not even sure if an optimal solution existed.

After having solved those problems, I have seen a pattern that is useful for solving general problem especially when the problem is abstract or you are not sure how to solve it.

I am not an expert I just want to express and share my point of view from my experiences toward technological problems. It might not apply to other fields or even other case scenarios in technological field.

I normally see a problem solving collapses…


Elasticbeantalk is a great service to deploy your app with minimum setup and you get app auto-scale out of the box without a need set up your own application load balancer from scratch.

In a web application, there is always a need to choose a domain as your primary domain for example in this case I choose example.com as the primary domain and www.example.com as an alternative domain and then redirect every request from www.example.com to example.com to avoid duplicate content or canonicalizing URL in every page.

301( permanent) redirect is an HTTP status code

As 301 redirection is not part of DNS but it happens at Http…


Last weekend I was exploring a solution to a daily problem of one of my friends to see how can technology help make life easier.

If you happen to travel from city to city using public transportations and you are not at the edge of where the fleet departs, you might have the same issue as him.

To show the problem better, let’s assume Mr. Jorge’s location is represented in the map as a person marker. The pink line string in the map shows the road where the fleet travels, and the direction of travel is from Top (Phnom Penh


ObEE is an open source, next generation Media Streaming end to end solution that supports modern streaming protocol HLS, Dash, WebRTC running on Linux, Nginx, FFMpeg and Janus.

The application runs on Erlang VM that support on demand video streaming, video broadcasting, live streaming, video and audio call, media annotation and realtime communication. Erlang VM is well-known for its stability, concurrency and massively scalable.

Why another Streaming solution?

Most (if not all ) big players in the market are not open-sourced or partially open-sourced providing limited integration, ugly API interface, old technologies, slow and very hard to setup.

ObEE will be powered by Elixir…

Ly Channa

A Software engineer and an Agile practitioner. My daily tasks: nodejs, rubyonrails, TDD, SQL, Bash, AWS, Circleci Js and more.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store