View chatgpt_service.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @note: This service is used to call the OpenAI API to generate a response to a message | |
# @note: The API key is stored in the credentials file | |
# @param message [String] The message to generate a response for | |
# @param model [String] The model to use for the response [gpt-3.5-turbo, gpt-3.5-turbo-0301] | |
# @return [String] The generated response | |
# @example | |
# ChatgptService.call('What is your name?', 'gpt-3.5-turbo') | |
# => "\n\nI am an AI language model created by OpenAI, so I don't have a name. You can call me OpenAI or AI assistant." | |
# API Docs: https://platform.openai.com/docs/api-reference/chat/create | |
class ChatgptService |
View error.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/run/postgresql:5432 - accepting connections | |
[platform-postgresql] Granting SUPERUSER to toptal role | |
ALTER ROLE | |
[platform-postgresql] Set development environment | |
Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead! | |
Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead! | |
WARNING: Zeitwerk defines the constant Karafka after the directory | |
/Users/sulmanweb/.gem/gems/karafka-sidekiq-backend-1.4.6/lib/karafka |
View export_transaction_service.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# app/services/export_services/export_transaction_service.rb | |
# Example: | |
# ExportServices::ExportTransactionService.new({ user: User,last}).call | |
# ExportServices::ExportTransactionService.new({ user: User.last, from_date: '2022-01-01', to_date: '2022-09-01'}).call | |
module ExportServices | |
# ExportTransactionService | |
class ExportTransactionService | |
# initialize the service with user, from_date and to_date and setting transactions accordingly |
View email_job.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'sendgrid-ruby' | |
#### Example Call | |
# EmailJob.new.perform( | |
# @user.id, | |
# { name: @user.name }, | |
# ENV.fetch('EXPORT_TEMPLATE', nil), | |
# [ |
View create_document.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/graphql/mutations/create_document.rb | |
module Mutations | |
class CreateDocument < Mutations::BaseMutation | |
description "Create a document" | |
argument :doc, ApolloUploadServer::Upload, required: true, description: "The document to upload" | |
field :document, Types::Objects::DocumentType, null: false | |
field :code, Types::Enums::CodeEnum, null: false |
View create_document.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/graphql/types/objects/document_type.rb | |
module Mutations | |
class CreateDocument < BaseMutation | |
description "creates a document for the user in the system" | |
argument :doc, ApolloUploadServer::Upload, required: true | |
field :document, Types::Objects::DocumentType, null: false |
View api-rspec.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI RSpec Tests | |
on: [push, pull_request] | |
push: | |
paths: | |
- 'api/**' | |
pull_request: | |
paths: | |
- 'api/**' |
View minimal-responsive-signup-page-with-tailwindcss.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body class="bg-gray-100"> | |
<div class="" id="sign-up-page"> | |
<div class="max-w-xl mx-auto mt-2 md:mt-8 lg:mt-16"> | |
<!-- Heading --> | |
<div class="bg-white p-8 shadow rounded-lg"> | |
<!-- SVG Illustration --> | |
<!-- https://undraw.co/illustrations --> | |
<svg id="29e4b1a0-13d0-4a0f-9be2-3c3977a6a4ba" class="h-32 w-full mb-4 md:h-48" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="785" height="753.73" viewBox="0 0 785 753.73"><defs><linearGradient id="b4c3f788-9d51-49bd-96f9-c54f9fd51398" x1="452.8" y1="753.73" x2="452.8" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="gray" stop-opacity="0.25"/><stop offset="0.54" stop-color="gray" stop-opacity="0.12"/><stop offset="1" stop-color="gray" stop-opacity="0.1"/></linearGradient><linearGradient id="778ed1c4-cafd-494e-8a04-dc2b91aee6fd" x1="209.37" y1="339.46" x2="209.37" y2="101.61" xlink:href="#b4c3f788-9d51-49bd-96f9-c54f9fd51398"/><linearGradient id="92c6cb1b-63b4-4a00- |
View .rspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--require spec_helper | |
--format documentation |
NewerOlder