Skip to content

Instantly share code, notes, and snippets.

hey hey hey
diff --git a/StockManager/src/stockmanager/AddItemScreen.form b/StockManager/src/stockmanager/AddItemScreen.form
index f9524b1..504b59a 100644
--- a/StockManager/src/stockmanager/AddItemScreen.form
+++ b/StockManager/src/stockmanager/AddItemScreen.form
@@ -2,11 +2,16 @@
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
- <Property name="defaultCloseOperation" type="int" value="2"/>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@fffergal
fffergal / gist:7902825
Created December 11, 2013 00:12
Sphinx extension for adding titles to autodoc classes.
from sphinx.ext.autodoc import ClassDocumenter
class TitledClassDocumenter(ClassDocumenter):
def add_directive_header(self, *args, **kwargs):
title_lines = [
self.object_name,
'=' * len(self.object_name),
'',
]
@fffergal
fffergal / -
Created November 19, 2014 21:51
INSERT INTO news_cuttings (title, download, date_added) VALUES ('Adopt a strategic approach to cereal disease control - FarmBusiness', 'downloads/cuttings/FB_18.04.14.jpg', '2014-04-18');
INSERT INTO news_cuttings (title, download, date_added) VALUES ('Mike Forshaw on ProCam careers - Agronomist & Arable Farmer', 'downloads/cuttings/AAF_11.04.14.jpg', '2014-04-11');
INSERT INTO news_cuttings (title, download, date_added) VALUES ('Crop production in a climate change future - Agronomist & Arable Farmer', 'downloads/cuttings/AAF_11.04.14KT.pdf', '2014-04-11');
INSERT INTO news_cuttings (title, download, date_added) VALUES ('What shapes company culture? - Agronomist & Arable Farmer', 'downloads/cuttings/AAF_11.04.14RI.jpg', '2014-04-11');
INSERT INTO news_cuttings (title, download, date_added) VALUES ('Mike Forshaw on ProCam careers - FarmBusiness', 'downloads/cuttings/FB_04.04.14.jpg', '2014-04-04');
INSERT INTO news_cuttings (title, download, date_added) VALUES ('Early spray is needed to control yellow rust as
@fffergal
fffergal / solarised-dark-magenta-cursor.js
Last active May 19, 2020 13:33
Solarized Dark theme for Blink with a magenta cursor
base03 = "#002b36";
base02 = "#073642";
base01 = "#586e75";
base00 = "#657b83";
base0 = "#839496";
base1 = "#93a1a1";
base2 = "#eee8d5";
base3 = "#fdf6e3";
yellow = "#b58900";
orange = "#cb4b16";
@font-face {
font-family: 'PragmataPro Mono';
font-weight: normal;
font-style: normal;
src: local('PragmataPro Mono');
}
@fffergal
fffergal / gist:784a1569dc71b10e76a245e7155c9768
Created July 14, 2017 16:11
"write good" Drafts app action URL
x-drafts4://x-callback-url/import_action?v=2&tintColor=%5B%0A%0A%5D&shouldConfirm=0&logLevel=1&uuid=89A3A285-224F-4317-B1B2-D4BB48AEB6AF&disposition=3&actionSteps=%5B%0A%20%20%7B%0A%20%20%20%20%22scriptText%22%20%3A%20%22%5C%2F%2A%5CnBased%20on%20a%20webpacked%20version%20of%20https%3A%5C%2F%5C%2Fgithub.com%5C%2Fbtford%5C%2Fwrite-good.%5Cn%5Cn%5CnLicense%20for%20this%20Draft%20app%20action%3A%5CnCopyright%202017%20Fergal%20Hainey%5Cn%5CnLicensed%20under%20the%20Apache%20License%2C%20Version%202.0%20%28the%20%5C%22License%5C%22%29%3B%5Cnyou%20may%20not%20use%20this%20file%20except%20in%20compliance%20with%20the%20License.%5CnYou%20may%20obtain%20a%20copy%20of%20the%20License%20at%5Cn%5Cn%20%20%20%20http%3A%5C%2F%5C%2Fwww.apache.org%5C%2Flicenses%5C%2FLICENSE-2.0%5Cn%5CnUnless%20required%20by%20applicable%20law%20or%20agreed%20to%20in%20writing%2C%20software%5Cndistributed%20under%20the%20License%20is%20distributed%20on%20an%20%5C%22AS%20IS%5C%22%20BASIS%2C%5CnWITHOUT%20WARRANTIES%20OR%20CONDITIONS%20OF%20ANY%2
# With 100 classes
In [34]: things = {i: list(type('hey', (object,), {})() for j in range(10)) for i in range(10
...: )}
In [35]: %%timeit -o the_type = type(choice(list(instance for key, instances in things.items(
...: ) for instance in instances)))
...: any(the_type is type(instance) for key, instances in things.items() for instance in
...: instances)
The slowest run took 16.05 times longer than the fastest. This could mean that an intermediate result is being cached.
9.32 µs ± 5.88 µs per loop (mean ± std. dev. of 7 runs, 100000 loops each)