This file contains hidden or 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
# jsonrepair.py - Repair invalid JSON documents in Python | |
# | |
# Just https://github.com/josdejong/jsonrepair ported from TypeScript to Python. | |
# | |
# This port won't get updates, because the goal should be to generate this library instead. | |
# | |
# See: https://github.com/josdejong/jsonrepair/issues/84 | |
# | |
import json |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Klokantech Basic GL Style using ol-mapbox-style preview</title> | |
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans" /> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.19.1/ol.css"> | |
<style> | |
html, body { | |
height: 100%; | |
margin: 0; |
This file contains hidden or 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
#!/bin/bash | |
code | |
while true; do | |
WINDOW_ID=$(xprop -root _NET_ACTIVE_WINDOW | cut -d ' ' -f 5 | cut -c 1-9) | |
WINDOW_CLASS=$(xprop -id $WINDOW_ID WM_CLASS | sed 's/.*= "\([^"]*\)".*/\1/') | |
if [ "${WINDOW_CLASS,,}" = "code" ]; then | |
break | |
fi | |
done | |
wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz |
This file contains hidden or 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
from contextlib import AbstractContextManager | |
from types import SimpleNamespace | |
class Context(SimpleNamespace, AbstractContextManager): | |
def __enter__(self): | |
self._globals = dict(globals()) | |
globals().update(self.__dict__) | |
return self |