Skip to content

Instantly share code, notes, and snippets.

View oshinko's full-sized avatar

Oshinko oshinko

View GitHub Profile
@oshinko
oshinko / nginx.conf
Created March 11, 2021 05:30 — forked from mreschke/nginx.conf
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route
@oshinko
oshinko / uint_7bit.py
Last active October 14, 2021 16:59 — forked from delimitry/uint_7bit.py
Python version of unsigned integer 7-bit encoder and decoder
def encode_to_7bit(value):
"""
Encode unsigned int to 7-bit str data
"""
data = []
number = abs(value)
while number >= 0x80:
data.append((number | 0x80) & 0xff)
number >>= 7
data.append(number & 0xff)