Skip to content

Instantly share code, notes, and snippets.

View mabsboza's full-sized avatar
🤙

JamesCode mabsboza

🤙
View GitHub Profile
require 'aws-sdk-s3'
require 'uri'
class S3Downloader
def initialize(region:, access_key_id:, secret_access_key:, bucket_name:)
@s3 = Aws::S3::Client.new(
region: region,
access_key_id: access_key_id,
secret_access_key: secret_access_key
)
class ContractorObject
attr_accessor :activity, :contractor_id
def initialize(activity, contractor_id)
raise ArgumentError, "Activity must not be empty" if activity.nil? || activity.strip.empty?
@contractor_id = contractor_id
@activity = activity
end
end
class MetaContractorObject
VALID_SUB_CATEGORIES = ['PERMANENTE', 'ESPORÁDICO', 'HABITUAL'].freeze
attr_accessor :sub_category, :meta_contractor_id
def initialize(meta_contractor_id, sub_category)
raise ArgumentError, "Invalid sub_category: #{sub_category}. Must be one of: #{VALID_SUB_CATEGORIES.join(', ')}" unless VALID_SUB_CATEGORIES.include?(sub_category)
@meta_contractor_id = meta_contractor_id
@sub_category = sub_category
1. Instalar el paquete de Intercom para PHP
Primero, instala el paquete oficial de Intercom para PHP utilizando Composer:
<dl>
bash
composer require intercom/intercom-php
</dl>
if [ "$#" -ne 1 ]; then
echo "Usage: $0 [personal|work1|work2]"
exit 1
fi
if [ "$1" == "personal" ]; then
git config --global user.name "Tu Nombre"
git config --global user.email "[email protected]"
elif [ "$1" == "chile" ]; then
git config --global user.name "Tu Nombre Trabajo 1"
class DeactivateInactiveContractorWorkers
def perform
Site.where(app: 'mall').includes(staffing_contractors: :non_archived_jobs).each do |site|
next unless site.contractor_worker_expiration_days
@expiration_days = site.contractor_worker_expiration_days
site.staffing_contractors do |contractor|
next if has_active_job?(contractor)
active_contractor_workers = contractor.alive_contractor_workers
import React from 'react'
import User from '../User'
function Welcome() {
return (
<div className="Welcome">
Welcome page rendered after login
ContractorWorker.all.each do |worker|
worker_status = if worker.banished_at?
ContractorWorker::Status::DISABLED
elsif !worker.approved?
ContractorWorker::Status::REJECTED
elsif worker.approved? && worker.without_access
ContractorWorker::Status::INCOMPLETE
elsif worker.approved? && !worker.without_access
ContractorWorker::Status::APPROVED
import React, { useState } from 'react';
import { slice } from 'lodash';
import { ArrowRightOutlined } from '@ant-design/icons';
import {
Button,
Col,
Divider,
Row,
Typography,
} from 'antd';
# Description
Please include a summary of the change and which issue is fixed or feature, include relevant context and List any dependencies that are required for this change.
Feature/Fix # [(Referenced card)](URL)
## Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)