Skip to content

Instantly share code, notes, and snippets.

View facelessuser's full-sized avatar
💭
Screaming into the void 😱

Isaac Muse facelessuser

💭
Screaming into the void 😱
View GitHub Profile
@facelessuser
facelessuser / os_specific_user_files.py
Last active February 1, 2016 03:47
Os Specific Backup for ST2
# -*- coding: utf-8 -*-
"""
OS Specific User Files is released under the MIT license.
Copyright (c) 2012 Isaac Muse <isaacmuse@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@facelessuser
facelessuser / cli.py
Last active July 8, 2017 23:14
Grep like search in python. (broken)
"""
Rummage (cli).
Licensed under MIT
Copyright (c) 2011 - 2015 Isaac Muse <isaacmuse@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@facelessuser
facelessuser / hexviewer.py
Last active August 29, 2015 13:56
hexviewer.py
# !/usr/bin/python
"""
Hex Viewer
Licensed under MIT
Copyright (c) 2011 Isaac Muse <isaacmuse@gmail.com>
"""
import struct
from os.path import getsize, abspath, normpath
from glob import glob
import sys
@facelessuser
facelessuser / ase.py
Last active August 29, 2015 14:16
ase
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import struct
import re
import sys
PY3 = sys.version_info >= (3, 0)
if PY3:
uchr = chr
import sublime
import subprocess
import tempfile
import os
import base64
class TempFile(object):
"""Open either a temporary HTML or one at the save location."""
@facelessuser
facelessuser / json_strip.py
Last active April 1, 2019 17:28
json_strip
"""
File Strip.
Licensed under MIT
Copyright (c) 2012 - 2019 Isaac Muse <isaacmuse@gmail.com>
"""
import re
LINE_PRESERVE = re.compile(r"\r?\n", re.MULTILINE)
JSON_COMMENTS_PATTERN = re.compile(
@facelessuser
facelessuser / pymdownx_shebang.py
Last active April 15, 2021 00:43
Parse shebangs in fences
"""Override default highlighter to handle shebangs."""
import re
RE_SHEBANG = re.compile(r'\A\#!(\w+)\b\s*\r?\n')
def md_shebang(src="", language="", class_name=None, options=None, md="", **kwargs):
"""Formatter wrapper."""
try:
@facelessuser
facelessuser / luv.py
Last active September 15, 2021 18:12
Luv and Lchuv for Coloraide
"""
Luv and Lch class.
https://en.wikipedia.org/wiki/CIELUV
"""
from coloraide.spaces import Space, RE_DEFAULT_MATCH, GamutUnbound, Percent, WHITES, Cylindrical, Angle
from coloraide.spaces.xyz import XYZ
from coloraide import util
from coloraide import Color as ColorOrig
import copy
@facelessuser
facelessuser / din99o.py
Last active September 8, 2021 17:44
Din99o Lab and Lch
"""
Din99o class.
https://de.wikipedia.org/wiki/DIN99-Farbraum
"""
from coloraide.spaces import RE_DEFAULT_MATCH
from coloraide.spaces.xyz import XYZ
from coloraide.spaces.lch.base import LchBase
from coloraide.spaces.lab.base import LabBase, lab_to_xyz, xyz_to_lab
from coloraide import util
@facelessuser
facelessuser / hsluv.py
Last active November 19, 2021 17:43
HSLuv and HPLuv
"""
HSLuv and HPLuv.
Adapted to Python and ColorAide by Isaac Muse (2021)
--- HSLuv Conversion Algorithm ---
Copyright (c) 2012-2021 Alexei Boronine
Copyright (c) 2016 Florian Dormont