Skip to content

Instantly share code, notes, and snippets.

@spillz
spillz / widget_spam.html
Last active November 2, 2023 20:46
Widget spam examples
<!DOCTYPE html>
<title>ESKV Widget Spam Example</title>
<!-- The CSS in the style tag is used to set a black background and maximize available client space for the canvas-->
<style>
body{
background-color: rgb(0, 0, 0);
text-align: center;
}
html, body, canvas {
@spillz
spillz / docx_emf_patch.py
Created January 12, 2021 20:49
Monkey patch for python-docx to enable EMF support
# encoding: utf-8
# This module monkey patches the docx library to add support for Windows Enhanced Metafile images (EMF)
# Put in a local folder and "import docx_emf_patch" to enable EMF support.
from __future__ import absolute_import, division, print_function
import docx
from docx.image.exceptions import UnrecognizedImageError
from docx.image.constants import MIME_TYPE
from docx.image.exceptions import InvalidImageStreamError
@spillz
spillz / Dynamic Fixed Effects Panel Data Model.ipynb
Last active February 17, 2022 19:41
Demonstrate dynamic panel data estimation using IV in linearmodels
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spillz
spillz / wxSmithCopyPaste.patch
Last active March 9, 2016 20:57
A patch for Code::Blocks to make cut copy paste shortcuts work for wxSmith
Index: src/plugins/contrib/wxSmith/wxwidgets/wxsitemeditor.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/wxsitemeditor.cpp (revision 10323)
+++ src/plugins/contrib/wxSmith/wxwidgets/wxsitemeditor.cpp (working copy)
@@ -72,6 +72,9 @@
InitializeResourceData();
InitializeVisualStuff();
m_AllEditors.insert(this);
+ Connect(wxID_COPY, (wxObjectEventFunction)&wxsItemEditor::Copy);
+ Connect(wxID_PASTE, (wxObjectEventFunction)&wxsItemEditor::Paste);
@spillz
spillz / proplayout.py
Created January 19, 2015 01:55
GTK3 Conversion of Proportional Layout
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import cairo
from gi.repository import GObject
class ProportionalLayoutChild:
def __init__(self,widget,left,right,top,bottom):
self.widget=widget
self.left=left
@spillz
spillz / kivy.py
Created July 21, 2014 17:15
kivy properties example
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.floatlayout import FloatLayout
Builder.load_string('''
#:kivy 1.6
<MyLayout>:
    my_rect_size: self.size[0]/2, self.size[1]/2
    canvas:
        Color:
#simple program to illustrate potential memory leak (circular reference?) with pyglet
import pyglet
from pyglet.gl import *
import gc
gc.set_debug(gc.DEBUG_LEAK)
window = pyglet.window.Window()
glClearColor(0.2, 0.4, 0.5, 1.0)