Skip to content

Instantly share code, notes, and snippets.

View herko's full-sized avatar
💭
I may be slow to respond.

Lubomir Herko herko

💭
I may be slow to respond.
View GitHub Profile
@herko
herko / github_ci.yml
Created May 20, 2021 08:11
Github CI
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Ruby
@herko
herko / route.tsx
Created April 11, 2023 19:55 — forked from rphlmr/route.tsx
Remix Supabase Upload
// if you don't plan to upload only images :
/*
async function convertToFile(data: AsyncIterable<Uint8Array>) {
const chunks = [];
for await (const chunk of data) {
chunks.push(chunk);
}
return chunks;
}
# This is an ExchangeRate model class. It is responsible for keeping local exchange rates up to date.
# Cron job trigger `ExchangeRate.update` to periodically refresh rates. This method also verifies if `auto` update is enabled. This gives admin ability to temporary disable refreshing.
# The update method fetches refresh rates and creates either direct conversion between two currencies, or indirect (through 3rd currency) if its not available.
# This implementation works as is, but can be better. Please refactor this class to extract and separate responsibilities and overall improve code quality.
require 'money/bank/open_exchange_rates_bank'
class ExchangeRate < ActiveRecord::Base
CURRENCIES = %w[usd eur aed] # and more