Skip to content

Instantly share code, notes, and snippets.

View dongido001's full-sized avatar
🕳️
../

Onwuka Gideon dongido001

🕳️
../
View GitHub Profile
  • What's Dev Of Future

    Dev Of Future is an Open source community where programmers share ideas and help each other grow. Because we know it takes a village to raise a coder, we create our virtual village for sharing and discovering great ideas, having debates, and making friends. Anyone can share articles, questions, discussions, etc. Connecting developers, and anyone who wants to learn and share his knowledge with other : that's our mission. We also provide access to the best learning resources from around the world.

    At Dev Of Future, we connect people who have knowledge to people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge for the benefit of the rest of the world.

The community is in fact made of passionate developers sharing same ideas and who want to conquert the world with their works. Providing easy access to information: We are empowering the community with the best r

@dongido001
dongido001 / python-binary-gap-solution-regex.py
Last active May 22, 2019 15:59
[Python] Binary gap solution using Regular Expression
import re
from functools import reduce
def solution(N):
# write your code in Python 3.6
m = re.findall(r"1*(0+)1", f"{N:b}")
def largest(x, y): return x if len(x) > len(y) else y
return len(reduce(largest, m)) if len(m) else 0
laravel new stream-chat-laravel && cd stream-chat-laravel
php artisan serve
# Install dependencies
yarn install
# Watch for file changes
yarn run watch
cd stream-chat-laravel
composer require get-stream/stream-chat
yarn add stream-chat
php artisan make:model Channel --migration
// [...]
Schema::create('channels', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->unsignedBigInteger('from_id');
$table->unsignedBigInteger('to_id');
$table->timestamps();
$table->foreign('from_id')->references('id')->on('users');
$table->foreign('to_id')->references('id')->on('users');