Skip to content

Instantly share code, notes, and snippets.

View maelfosso's full-sized avatar

Mael FOSSO maelfosso

View GitHub Profile
@maelfosso
maelfosso / ts-boilerplate.md
Created July 21, 2021 06:39 — forked from silver-xu/ts-boilerplate.md
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@maelfosso
maelfosso / Decode Message.md
Last active July 29, 2020 21:46
Decode Message - Algorithms

Decode Message

Given the mapping a = 1, b = 2, ... z = 26, and an encoded message message (as a string), count the number of ways it can be decoded.
For example, the message 111 should return 3, since it could be decoded as aaa, ka, and ak.
You can assume that the messages are decodable. For example, 001 is not a valid input.

Example 1

Input

@maelfosso
maelfosso / development.log
Created July 14, 2020 18:10
Log when running `bundle exec karafka exec`
Initializing Karafka server 3610
Karafka version: 1.3.6
Ruby version: 2.6.5
Ruby-kafka version: 1.1.0
Application client id: nkapsi_accounts_development
Backend: inline
Batch fetching: true
Batch consuming: false
Boot file: /home/maelfosso/Documents/Projects/Nkapsi/api/accounts/karafka.rb
Environment: development
@maelfosso
maelfosso / business_consumer.rb
Created July 13, 2020 21:28
I tried to set Karafka on a Ruby on rails application to be able to consumer and produce kafka message but it didn't work here are my configuration file
# app/consumers/business_consumer.rb
class BusinessConsumer < ApplicationConsumer
def consume
Karafka.logger.info "New [Business] event: #{params}"
end
end
@maelfosso
maelfosso / README.md
Last active April 7, 2018 10:48
Chef decided to find the connections with all of his friends in an unnamed social network. He calls a user of the social network his friend if there is a common substring of the string "chef" and the nickname of that user with length ≥ 2. Given a list of users of the social network, compute the number of Chef's friends.

Introduction

The problem comes from codechef

It is an example of how we will work in GDG Yaounde

My Solution

  1. I create a vector containing substrings of length upper than 2 from the word chef.
  2. After reading all the username, I loop through them and and if an username contains one of the substring inside the vector create above then I will increment the result

Testing