Skip to content

Instantly share code, notes, and snippets.

View Babatunde13's full-sized avatar
🎯
Focusing

Babatunde Mudathir Koiki Babatunde13

🎯
Focusing
View GitHub Profile
@Xavier577
Xavier577 / websocket_nodejs_implementation.md
Last active January 18, 2025 00:38
Implementing a websocket server without any libraries with raw nodejs

Code snippet

import { createServer } from "http";
import crypto from "crypto";

const PORT = 8001;

// this is from the web-socket specification and not something that is generated
const WEBSOCKET_MAGIC_STRING_KEY = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
import logging
import os
import grpc
from protos import hello_pb2, hello_pb2_grpc
def get_filepath(filename, extension):
return f'{filename}{extension}'
def read_iterfile(filepath, chunk_size=1024):
from concurrent import futures
import logging
import os
import grpc
from protos import hello_pb2, hello_pb2_grpc
def get_filepath(filename, extension):
return f'{filename}{extension}'
def get_filepath(filename, extension):
return f'{filename}{extension}'
class Greeter(hello_pb2_grpc.GreeterServicer):
....
def UploadFile(self, request_iterator, context):
data = bytearray()
filepath = 'dummy'
import logging
import os
import grpc
from protos import hello_pb2, hello_pb2_grpc
def run():
with grpc.insecure_channel('localhost:50051') as channel:
stub = hello_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(hello_pb2.HelloRequest(name='John Doe', age=30))
print("Greeter client received: " + response.message)
@Olanetsoft
Olanetsoft / Getting-started-with-dapps.md
Last active January 1, 2024 17:56
Series 1: Mara Blockchain Masterclass - Nigeria

Series 1: Mara Blockchain Masterclass - Nigeria

This workshop is targeted at developers who are transitioning from Web2 to Web3 or have just recently gotten into Web3 and are looking to have a well-rounded foundation.

This first workshop is Series 1 in the three-part series that aims to introduce you to the blockchain and how to build on the blockchain.

Steps to set up a project, build and deploy a smart contract.

Step 1

@Babatunde13
Babatunde13 / app.py
Last active March 31, 2024 08:41
The first part of my Flask and SQLAlchemy series.
from flask import Flask, jsonify, request
from flask_sqlalchemy import SQLAlchemy
import uuid
app = Flask(__name__)
db = SQLAlchemy(app)
app.config['SECRET_KEY']='secret'
app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///app.db'
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active July 7, 2025 06:45
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@supriya-premkumar
supriya-premkumar / dockerCheatSheet.md
Last active February 21, 2025 08:33
Docker Commands