Skip to content

Instantly share code, notes, and snippets.

@chrisdone
chrisdone / Intro.md
Last active May 20, 2024 12:44
Statically checked overloaded strings

Statically checked overloaded strings

This gist demonstrates a trick I came up with which is defining IsString for Q (TExp a), where a is lift-able. This allows you to write $$("...") and have the string parsed at compile-time.

On GHC 9, you are able to write $$"..." instead.

This offers a light-weight way to enforce compile-time constraints. It's basically OverloadedStrings with static checks. The inferred return type

@ShlomiRex
ShlomiRex / main.py
Created October 30, 2021 22:56
Python Selenium - Brave + Tor
_brave_path = r'C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe'
def get_brave_tor_driver():
option = webdriver.ChromeOptions()
option.binary_location = _brave_path
option.add_argument("--tor") # Launch in Tor mode
driver = webdriver.Chrome(executable_path=_chrome_driver_path, chrome_options=option)
return driver