This file contains hidden or 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
    
  
  
    
  | export const useUpdatableTimestamp = (controller) => { | |
| return Object.assign(controller, { | |
| timeAgoInWordsWithParsing(from) { | |
| const date = new Date; | |
| date.setTime(Date.parse(from)); | |
| return this.timeAgoInWords(date); | |
| }, | |
| timeAgoInWords(from) { | |
| return this.distanceOfTimeInWords(new Date(), from); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | import { Controller } from "stimulus"; | |
| export default class extends Controller { | |
| static targets = ["submit", "inputs" ]; | |
| static values = { | |
| enabled: Boolean, | |
| } | |
| connect() { | |
| if(this.enabledValue) { | 
  
    
      This file contains hidden or 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 | |
| module Conversation::PgSearch | |
| extend ActiveSupport::Concern | |
| included do | |
| include PgSearch::Model | |
| pg_search_scope :where_participant_name_is, associated_against: { | |
| contacts: %i[first_name last_name], | |
| lists: :name | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #!/usr/bin/env bash | |
| # resetting and seeding the database | |
| echo "[ bin/ci ] migrating the test database" | |
| bin/rails db:migrate:reset RAILS_ENV=test | |
| echo "[ bin/ci ] Running rspec tests" | |
| bin/bundle exec rspec spec | 
  
    
      This file contains hidden or 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
    
  
  
    
  | class TodoFacade | |
| include ActiveModel::Validations | |
| attr_reader :todo_set, :todos | |
| validates_presence_of :author | |
| def initialize(todo_set:) | |
| @todo_set = todo_set | |
| @todos = @todo_set.books | 
  
    
      This file contains hidden or 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
    
  
  
    
  | import 'dart:convert' as json; | |
| import 'package:dio/dio.dart'; | |
| import 'package:shared_preferences/shared_preferences.dart'; | |
| import 'package:uni_capstone_project/models/patient.dart'; | |
| enum Result { | |
| SUCCESS, | |
| FAILED, | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | class CartService | |
| include ActiveModel::Attributes | |
| include ActiveModel::Validations | |
| attr_accessor :cart | |
| validates_presence_of :cart | |
| def initialize(cart:) | |
| @cart = cart | 
  
    
      This file contains hidden or 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
    
  
  
    
  | import 'dart:io'; | |
| import 'package:cloud_firestore/cloud_firestore.dart'; | |
| import 'package:firebase_core/firebase_core.dart'; | |
| import 'package:firebase_storage/firebase_storage.dart'; | |
| import 'package:path_provider/path_provider.dart'; | |
| class FirebaseCloudWrapper { | |
| FirebaseStorage _storage = FirebaseStorage( | |
| storageBucket: "gs://sapphire-restaurant.appspot.com/", | 
  
    
      This file contains hidden or 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
    
  
  
    
  | def fizzbuzz(last_number:) | |
| (1..last_number).each do |number| | |
| if (number % 15).zero? | |
| puts "FizzBuzz" | |
| elsif (number % 5).zero? | |
| puts "Buzz" | |
| elsif(number % 3).zero? | |
| puts "Fizz" | |
| else | |
| puts number | 
  
    
      This file contains hidden or 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
    
  
  
    
  | class MultiplicationTable | |
| def initialize(from:, to:) | |
| @from = from | |
| @to = to | |
| end | |
| def print_multiplication_table | |
| (@from..@to).each do |number| | |
| puts multiplication_table_for number | |
| end | 
NewerOlder