Skip to content

Instantly share code, notes, and snippets.

Avatar

ObserverOfTime

View GitHub Profile
@ObserverOfTime
ObserverOfTime / svgimagefield.py
Last active Oct 28, 2020 — forked from ambivalentno/svgimagefield.py
A form field to handle validation of image + svg.
View svgimagefield.py
from xml.etree import cElementTree as et
from django.core.exceptions import ValidationError
from django.forms import ImageField
class SVGImageField(ImageField):
"""A Django ImageField that accepts SVG images."""
def to_python(self, data):
"""
View semver.sh
#!/bin/bash -e
###
# Semantic version comparison using semver specification http://semver.org/
# This bash script compares pre-releases alphabetically as well
#
# returns 1 when A greater than B
# returns 0 when A equals B
# returns -1 when A lower than B
#
@ObserverOfTime
ObserverOfTime / css-inject.js
Last active Mar 29, 2019 — forked from 1j01/README.md
GitHub Desktop Dark Theme - NO LONGER MAINTAINED
View css-inject.js
/**
* To apply the theme:
* 1) Open dev tools with CTRL + SHIFT + I
* 2) Go to the console
* 3) Paste the following code
* Note: You will have to do this again whenever Github Desktop updates
*/
const fs = require('fs');
const path = require('path');