This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Creates a new i3 workspace with a number one greater than the last numbered workspace. If there are no numbered workspaces, uses 1. | |
""" | |
from i3ipc import Connection | |
def workspace_name_to_int(name): | |
digits = "".join([ | |
d for d in name if d.isdigit() | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logger = logging.getLogger("testLogger") | |
logger.setLevel(logging.DEBUG) | |
handler = logging.StreamHandler() | |
handler.setLevel(logging.DEBUG) | |
class CustomFormatter(logging.Formatter): | |
def format(self, record): | |
original_log_message = super().format(record) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- GrahamScan.hs | |
-- Implements Graham's Scan algo to find the convex hull of a group of 2D points | |
-- http://en.wikipedia.org/wiki/Graham_scan | |
import GHC.Exts | |
import Data.List | |
data Point = Point { | |
x :: Double, | |
y :: Double |