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
class Phones::Creator | |
attr_reader :phone_params | |
delegate :contact, to: :phone | |
def initialize(phone_params) | |
@phone_params = phone_params | |
end | |
def call |
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
import java.util.Scanner; | |
class MyClass { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int dia = scanner.nextInt(); | |
switch(dia) { | |
case 1: { |
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
// Problem: https://www.hackerrank.com/challenges/migratory-birds/problem | |
function migratoryBirds(arr) { | |
// Write your code here | |
// Contar os tipos e armazenar o valor deles em uma variavel | |
// Salvar em uma variavel do tipo objeto | |
const birdsTypes = { | |
1: 0, | |
2: 0, | |
3: 0, | |
4: 0, |
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
console.log("heeey") |
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
function bonAppetit(bill, k, b) { | |
// Write your code here | |
let total = 0; | |
for(let i = 0; i < bill.length; i++) { | |
if (i !== k) { | |
total += bill[i]; | |
} | |
} | |
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
map <Leader>r :terminal docker-compose exec spring rspec --order defined --format d %<CR> |
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
# Problem: https://leetcode.com/problems/split-a-string-in-balanced-strings/ | |
# @param {String} s | |
# @return {Integer} | |
def balanced_string_split(s) | |
balance = 0 | |
total_count = 0 | |
s.split("").each do |value| | |
if value == "R" |
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
# Ring the bell if any background window rang a bell | |
set -g bell-action any | |
# Default termtype. If the rcfile sets $TERM, that overrides this value. | |
set -g default-terminal screen-256color | |
# Keep your finger on ctrl, or don't | |
bind-key ^D detach-client | |
# Create splits and vertical splits |
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
# find_each loses order of previous sorted relations | |
# under the hook it users some primary key ordering | |
# a workaround to perform iterations in batches is | |
batch_size = 100 | |
ordered_ids = Model.ordered.pluck(:id) | |
ordered_ids.each_slice(batch_size) do |slice| | |
HeavyWork.call(slice) | |
end |
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
# [gem_name] _[version]_ [args go here] | |
bundle _1.17.3_ install |
NewerOlder