Skip to content

Instantly share code, notes, and snippets.

View mattharrison's full-sized avatar

matt harrison mattharrison

View GitHub Profile
@mattharrison
mattharrison / noleak.py
Created December 3, 2010 18:18
attempt to see if drawing charts caused leaks, note that this removes the drawer portion and goes straight to ctx. I'm not seeing leaks with this.
import time
import random
import sys, os, gc
import pango
import cairo
import pangocairo
class _Graph():
@mattharrison
mattharrison / gist:734308
Created December 9, 2010 03:43
using gc in qtile
diff --git a/libqtile/manager.py b/libqtile/manager.py
index 17175de..5283b01 100644
--- a/libqtile/manager.py
+++ b/libqtile/manager.py
@@ -596,6 +596,21 @@ class Log:
def clear(self):
self.log = []
+def get_leaking_objects():
+ """
@mattharrison
mattharrison / config.py
Created March 23, 2011 13:38
My current qtile config that takes 90+% cpu
from libqtile.manager import Click, Drag, Group, Key, Screen
from libqtile.command import lazy
from libqtile import layout, bar, widget, hook
LEFT_ALT = 'mod1'
WINDOWS = 'mod4'
FONT = 'Envy Code R'
FONTSIZE = 13
CHAM1 = '8AE234'
CHAM3 = '4E9A06'
@mattharrison
mattharrison / gpxshrink.py
Created August 31, 2012 05:16
python code to concat/shrink gpx files
# attempt to shrink gpx files and concat them to get on android device
# got zip file with gpx from http://www.phillowry.com/wasatchwatch.htm
# converted to kml with gpx2kml.com
# gaia gps bogged down with files...
# my tracks does ok with them
import sys
import xml.etree.ElementTree as et
def concat(fins, fout, stride):
tree = et.ElementTree()
@mattharrison
mattharrison / two kf8 comic pages
Created October 22, 2012 05:39
The first of these html pages does NOT work as a kf8 comic, the second does... confusion ensues
Why does the second file/page work as a kf8 comic and the first doesn't?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test Comic25</title>
<style type="text/css">
/* This first section of the stylesheet is called a CSS Reset. */
/* A CSS Reset removes inconsistent formatting that browsers often apply */
@mattharrison
mattharrison / gist:4005766
Created November 3, 2012 03:51
KF8 Comics - careful about quote type!
<!--<a class="app-amzn-magnify" data-app-amzn-magnify="{'targetId':'zoom1-magTargetParent', 'ordinal':4}" works='False'> -->
<a class="app-amzn-magnify" data-app-amzn-magnify='{"targetId":"zoom1-magTargetParent", "ordinal":4}' works='True'>
===========
Drone Lab
===========
Start IDLE
============
Run::
@mattharrison
mattharrison / README.txt
Created April 26, 2018 14:27
Beg Pytest README
=====================
Pytest Introduction
=====================
.. export PS1="$ "
Copyright 2018 - Matt Harrison
@__mharrison__
@mattharrison
mattharrison / gist:90dcbe5f37de7148533989fb4b8e3e69
Last active March 26, 2021 21:31
Mastering Pytest README
=====================
Intermediate Pytest
=====================
http://bit.ly/2019-07-01-pytest
These assignments are based on a Python implementation
that models a lift at a ski resort.
=====================
Pytest Introduction
=====================
.. export PS1="$ "
Copyright 2018 - Matt Harrison
@__mharrison__