Skip to content

Instantly share code, notes, and snippets.

@mgood
mgood / horizon-synthwave-glow.css
Created May 22, 2019 22:26
Glow effect for Horizon VS Code theme
/*
Adds glow effect to https://horizontheme.com
Glow based on https://github.com/robb0wen/synthwave-vscode
Use Custom CSS and JS Loader to apply:
https://marketplace.visualstudio.com/items?itemName=be5invis.vscode-custom-css
*/
/* Variables, property names, tags, markup headings */
.mtk5 {
@mgood
mgood / main.go
Created January 31, 2019 19:06
Go reflect.MakeFunc crash reproduction
package main
import (
"context"
"log"
"os"
"os/signal"
"reflect"
"strings"
"syscall"

Keybase proof

I hereby claim:

  • I am mgood on github.
  • I am matt_good (https://keybase.io/matt_good) on keybase.
  • I have a public key ASAP8p8tZTfNtUz7LYUG80iZp58pw8wyL69uuHzWMsUtUwo

To claim this, I am signing this object:

@mgood
mgood / Test results
Created May 29, 2015 21:21
jproperties functional tests
$ py.test
============================= test session starts ==============================
platform darwin -- Python 2.7.6 -- py-1.4.26 -- pytest-2.7.1
rootdir: /Users/matt/Projects/jprops/.venv/jprops/src/jproperties, inifile:
plugins: xdist
collected 66 items
test_functional.py ........FFFFFF...F.........FFF.FFFFFFFFFF....F...F.FFFFFF.F...FFFF
=================================== FAILURES ===================================
@mgood
mgood / sample.py
Created March 24, 2014 22:03
Example app for flask-failsafe PR #3
from flask import Flask
from flask_failsafe import failsafe
@failsafe
def create_app():
app = Flask(__name__)
app.config.update(
DEBUG=True,
SERVER_HOST='localhost',
SERVER_PORT=5001
@mgood
mgood / gist:6693271
Created September 25, 2013 00:25
HTTPretty errors with requests 2.0
======================================================================
FAIL: HTTPretty should support rotating responses with requests
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/nose/util.py", line 622, in newfunc
return func(*arg, **kw)
File "/Users/mgood/Projects/HTTPretty/httpretty/core.py", line 829, in wrapper
return test(*args, **kw)
@mgood
mgood / releases.py
Created June 5, 2013 20:29
PyPI XML-RPC errors
Fails on Python 2.6 with http:
$ python2.6 releases.py http
Traceback (most recent call last):
File "releases.py", line 5, in <module>
print xmlrpclib.ServerProxy('%s://pypi.python.org/pypi' % protocol).package_releases('roundup')
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1199, in __call__
return self.__send(self.__name, args)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
@mgood
mgood / Console output
Created August 22, 2012 00:31
Flask-DebugToolbar logging
$ python simpleapp.py
* Running on http://127.0.0.1:5000/
* Restarting with reloader
127.0.0.1 - - [21/Aug/2012 17:29:54] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/Aug/2012 17:29:54] "GET /favicon.ico HTTP/1.1" 404 -
@mgood
mgood / gist:3276107
Created August 6, 2012 16:19
Python expression evaluator
"""
An attempt to make a safe evaluator of a subset of Python expressions.
This is mostly a proof-of-concept for getting feedback, it has not been
thoroughly checked for safety, use at your own risk :)
It uses the Python ast module to parse the expression, but all evaluation is
done by walking the ast, it is not directly executed by the Python runtime.
Nosetests are provided below including coverage of supported and unsupported
@mgood
mgood / gist:2714694
Created May 16, 2012 22:52
Sentry Script interface
class Script(Interface):
def __init__(self, name, path=None):
self.name = name
self.path = path
def get_hash(self):
return [self.name]
def serialize(self):