Skip to content

Instantly share code, notes, and snippets.

View ryantam626's full-sized avatar

Ryan Tam ryantam626

  • London
View GitHub Profile
@ryantam626
ryantam626 / gist:b91577789c9aa283ba4adfd83c750886
Last active February 18, 2023 16:24
code formatter cursor pos update test
import ast
from collections import Counter
code_snippet_1 = """# this doesn't make sense as all lul
import requests # TROLOLOLOL
headers = {
'Referer': 'https://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236&DB_Short_Name=On-Time',
'Origin': 'https://www.transtats.bts.gov',
'Content-Type': 'application/x-www-form-urlencoded',
@ryantam626
ryantam626 / Dockerfile
Created July 27, 2022 10:04
Dockerised Python with LTO enabled and `-fno-semantic-interposition` compiler flag
# Python base image with tweaks - Mostly derivied from https://github.com/docker-library/python/blob/218e80410245922ec8e78ca8ca6630c5f47ca445/3.8/bullseye/Dockerfile
# Modification are highlighted by comments prefixed by "HACK: "
# {{
FROM buildpack-deps:bullseye
# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.