Skip to content

Instantly share code, notes, and snippets.

View cleicar's full-sized avatar
🌎
Working Remotely

Cleiviane Costa cleicar

🌎
Working Remotely
View GitHub Profile
@cleicar
cleicar / code.ruby
Last active June 28, 2023 14:53
Get the largest branch in a Binary Tree in Ruby
class BinaryTree
def initialize
@root = nil
@left_nodes = []
@right_nodes = []
end
def insert(value)
@root.nil? ? @root = TreeNode.new(value) : @root.insert(value)
end
@cleicar
cleicar / error-3.log
Created August 4, 2021 22:02
Nitro Error
➜ nitro-web git:(master) ✗ rails s
[DEPRECATED] Your lockfile contains a single rubygems source section with multiple remotes, which is insecure. You should run `bundle update` or generate your lockfile from scratch.
WARNING DEPARTURE IS DISABLED!!!
=> Booting Puma
=> Rails 5.2.4.5 application starting in development
=> Run `rails server -h` for more startup options
Exiting
Traceback (most recent call last):
51: from bin/rails:4:in `<main>'
50: from bin/rails:4:in `require'
@cleicar
cleicar / document.md
Created July 6, 2021 17:52
Telas - OPSICO
@cleicar
cleicar / challenge.txt
Last active February 28, 2021 00:26
Desafio para dev (Booking API)
# O Desafio
Escrever um aplicação Rails API onde usuários poderão agendar sessões com os especialistas cadastrados.
## Modelos
1. Profissional (Specialist)
2. Paciente (Patient)
3. Agendamento (Booking)
## Endpoints
@cleicar
cleicar / challenge.txt
Last active February 28, 2021 00:26
Desafio para dev - Gif Dir :)
### O Desafio
Escrever um código em Ruby para subir imagens gif, onde visitantes poderão ver e procurar por gifs.
## Requisitos
1. Como usuário, eu quero fazer upload de uma imagem no formato `.gif`, com um limite de 10mb por arquivo.
2. Como usuário, quero poder ver um GIF que enviei
3. Como usuário, eu quero marcar os gifs com uma ou mais tags.
4. Como visitante, eu quero fazer login com o Twitter e me tornar usuário.
5. Como visitante, eu quero ver todos os gifs marcados com uma tag específica.
@cleicar
cleicar / activestorage_extensions.rb
Created August 4, 2020 20:56
Active Storage Key
# config/initializers/activestorage_extensions.rb
# frozen_string_literal: true
module NitroAttached
def service_url
# url: user.avatar.url,
# filename: filename
end
@cleicar
cleicar / enfileirar.c
Last active May 12, 2020 21:52
Codigo Julia
public static void main(String[] args) {
Scanner leia = new Scanner(System.in);
Fila fila = new Fila(20);
Fila f1 = new Fila(3);
int opcao = 0;
while(opcao != 4) {
menu();
opcao = leia.nextInt();
switch(opcao) {
@cleicar
cleicar / tracker.js
Last active August 15, 2017 23:45
JS Libary that send all user navigation to a SimpleCRM account.
const SIMPLE_CRM_URL = 'https://my-simple-crm.herokuapp.com';
const USERNAME = 'cleiviane';
const PASSWORD = '12345678';
(function ($) {
var ready = $.fn.ready;
$.fn.ready = function (fn) {
addUserTrack();
@cleicar
cleicar / mongoid-shell-export
Last active June 6, 2017 14:29
Exportar e Restaurar databases via mongoidShell
namespace :backup do
[:development, :production].each do |env|
namespace env do
desc 'Faz o dump de uma base informada como parametro'
task :dump_database_collections => :environment do
Mongoid.load! File.join(Rails.root, "config/mongoid.yml"), env
database_name = ENV['db']
dump_dir = File.join(ENV['output'], database_name)