Skip to content

Instantly share code, notes, and snippets.

View leopard627's full-sized avatar

Leopard627 leopard627

  • South Korea
  • 15:15 (UTC +09:00)
View GitHub Profile
@timhughes
timhughes / fastapi_websocket_redis_pubsub.py
Last active February 21, 2025 08:41
FastAPI Websocket Bidirectional Redis PubSub
"""
Usage:
Make sure that redis is running on localhost (or adjust the url)
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html
pip install -u uvicorn
Install dependencies
@john-science
john-science / python.dockerfile
Last active July 11, 2021 22:56
Installing Python v3.8 dev on Ubuntu 20.04 via Docker
FROM ubuntu:20.04
RUN apt-get update && \
apt-get install --no-install-recommends -y python3-pip python3.8-dev && \
apt-get install vim && \
apt-get install git
@delthas
delthas / sni.go
Last active January 4, 2023 12:43
Disable SNI in Go HTTPS requests
url := "https://perdu.com"
hostname := "perdu.com"
sni := false
var serverName string
if sni {
serverName = hostname
} else {
// disable sending the ServerName by using an IP
@shobhitic
shobhitic / MyNFT.sol
Last active August 12, 2023 03:08
Simple NFT Staking Smart Contract - https://youtu.be/m0w6JyqJKks
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";
contract MyNFT is ERC721, Ownable {
uint256 public totalSupply;
constructor() ERC721("MyNFT", "MNFT") {}