Skip to content

Instantly share code, notes, and snippets.

@liviaerxin
liviaerxin / 1 - Intro---README.md
Last active April 16, 2022 17:29 — forked from lostintangent/1 - Intro---README.md
Learning MobX (Side-Effects)

1: Intro

Welcome to the interactive tutorial on how to use side-effect "operators" in MobX! Over the course of the next three samples, you'll learn (and be able to explore) exactly how autorun, when and reaction work, and when/why you would use them when building reactive applications.

@liviaerxin
liviaerxin / blog.md
Created April 16, 2022 17:38
gistlog #GistLog

hello gistlog

@liviaerxin
liviaerxin / dummy_thread.py #Python
Created May 20, 2022 01:55
Dummy thread to close gracefully
import threading
import time
import threading
import signal
class DummyThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self._running = True
@liviaerxin
liviaerxin / ping.py
Created June 9, 2022 07:45 — forked from pklaus/ping.py
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
@liviaerxin
liviaerxin / XOpenGLRenderAnimation.cpp
Created July 28, 2022 04:18
Create X11 window rendering an animation using OpenGL
/**
* @file XOpenGLRenderAnimation.cpp
* @author your name ([email protected])
* @brief
* @version 0.1
* @date 2022-07-27
*
* @copyright Copyright (c) 2022
* https://github.com/gamedevtech/X11OpenGLWindow
clang++ XOpenGLRenderAnimation.cpp -o XOpenGLRenderAnimation \
@liviaerxin
liviaerxin / simple_vpn_server_setting.md
Last active September 2, 2024 11:47
Simple VPN Server #vpn

VPN Server Setting

ocserv

# 
docker run --name ocserv --privileged -p 443:443 -p 443:443/udp -d tommylau/ocserv
# set username/password
docker exec -it ocserv ocpasswd -c /etc/ocserv/ocpasswd -g "Route,All" frank
# delete user
@liviaerxin
liviaerxin / app_lock.py
Created March 3, 2023 07:42
Limit only 1 request in a endpoint at a time #python
#main.py
from fastapi import FastAPI
import asyncio
app = FastAPI()
lock = asyncio.Lock()
counter = 0
@app.post('/limit')