Carlo Bertini's personal website

Web Developer/ Devops and problem solver adept at programming

Use Sqlite Instead of Db in Memory to Verify Foreign Key Constrains

How to check check Constrains in test ? Todo: i need to insert some description :D When we need to check check, we need to use Sqlite provider When use waht providers" When use waht providers using System; using System.Threading.Tasks; using Bogus; using Microsoft.EntityFrameworkCore; using TrackingConsumerService.Data; using TrackingConsumerService.Data.Models; using Xunit; namespace TrackingConsumerService.Test.Fixture { public class DbContextFixture : IDisposable { public MyDbContest DbContext { get; private set; } public DbContextFixture() { var options = new DbContextOptionsBuilder<MyDbContest>() .

Use Padrino and sprockets with sprockets-helpers

Thanks to @arthur_chiu and his post on how to integrate sprockets in Padrino with sprockets-helpers, i’ve create my version :D:D:D:D 1) Create padrino-sprockets in config/sprockets.rb module Padrino::Sprockets def self.registered(base) base.set :sprockets, # Add folder base.sprockets.append_path 'assets/javascripts' base.sprockets.append_path 'assets/stylesheets' base.sprockets.append_path 'assets/images' base.set :digest_assets, true # compress file if PADRINO_ENV == 'development' base.sprockets.js_compressor = true) base.sprockets.css_compressor = end # sprockets-helpers base.helpers Sprockets::Helpers # We can configure \`sprockets-helpers\` to find the correct assets for us.

Padrino 0.11.0 Released - Padrino Lives!

The Padrino team is very pleased to finally be able to announce the 0.11.0 release of the Padrino Framework! We have been working on this release for almost a year now and we have had dozens of contributors helping us stabilize Padrino. We know our release cycle got out whack and this version took too long to release. We all take accountability for that and will work to pick up release momentum and release patch and minor versions more often.

Usage ImageSorcery with CarrierWave by gem

CarrierWave::ImageSorcery Additional processing to use ImageSorcery into CarrierWave. Installation Add this line to your application’s Gemfile: gem ‘carrierwave-imagesorcery’ And then execute: $ bundle Or install it yourself as: $ gem install carrierwave-imagesorcery Usage To use those, you should include specified module (ImageSorcery) into your uploader and use processors: class AvatarUploader < CarrierWave::Uploader::Base include CarrierWave::ImageSorcery ….. end Method implemented convert dimensions resize_to_limit resize_to_fit resize_to_fill resize_and_pad Example class Uploader < CarrierWave::Uploader::Base

The library is a simple API in Ruby for Microsoft Translator V2

MsTranslate The library is a simple API in Ruby for Microsoft Translator V2 The Microsoft Translator services can be used in web or client applications to perform language translation operations. The services support users who are not familiar with the default language of a page or application, or those desiring to communicate with people of a different language group. Installation Add this line to your application’s Gemfile: gem ‘ms_translate’ And then execute:

Padrino-admin Twitter Bootstrap v2.0 is ready

(Padrino Admin TwitterBootstrap 2.0) Padrino-Modal: rack-flash and delete function into modal :D highlights error field tof helper: Automatic replace true or false with relative image (list.slim and list.haml) Breadcrumbs Automatic time_ago_in_words when column model is created_at or updated_at Migrate function for MiniRecord Padrino-Modal All result from rack-flash and delete request, now is automatic insert into modal javascript plugin highlights error field tof_helper Automatic replace true or false with relative image (list.