Skip to content

Instantly share code, notes, and snippets.

View chris-allan's full-sized avatar

Chris Allan chris-allan

View GitHub Profile
@chris-allan
chris-allan / NetworkChecker.java
Last active December 19, 2015 19:38
Version of the NetworkChecker from OMERO.insight that has full debugging throughout
/*
* org.openmicroscopy.shoola.env.data.NetworkChecker
*
*------------------------------------------------------------------------------
* Copyright (C) 2006-2012 University of Dundee & Open Microscopy Environment.
* All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@chris-allan
chris-allan / get_thumbnail.py
Last active December 22, 2015 05:09
Simulates the same calls that would be made by OMERO.web to the ThumbnailStore
"""
Copyright (C) 2013 Glencoe Software, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
@chris-allan
chris-allan / OMERO5.0DEV__5.sql
Created September 4, 2013 10:55
OMERO5.0DEV__5 to OMERO5.0DEV__6 database upgrade script
-- Copyright (C) 2013 Glencoe Software, Inc. All rights reserved.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@chris-allan
chris-allan / dataset.py
Last active December 23, 2015 13:09
Create an OMERO Dataset from the command line
#!/usr/bin/env python
# encoding: utf-8
"""
Create an OMERO Dataset from the command line
Adapted from OME forum post of "Josh Moore <josh@glencoesoftware.com>":
* http://www.openmicroscopy.org/community/viewtopic.php?f=4&t=602
Copyright (C) 2013 Glencoe Software, Inc.
All rights reserved.
@chris-allan
chris-allan / build.gradle
Last active August 29, 2015 14:01
dev_5_0: Example Gradle build file for OMERO.importer on the CLI
apply plugin: 'application'
apply plugin: 'java'
mainClassName = 'ome.formats.importer.cli.CommandLineImporter'
def javaOpts = [
'-Dlog4j.configuration=log4j-cli.properties',
'-Xmx512M'
]
@chris-allan
chris-allan / build.gradle
Created May 21, 2014 20:37
dev_4_4: Example Gradle build file for OMERO.importer on the CLI
apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'eclipse'
mainClassName = 'ome.formats.importer.cli.CommandLineImporter'
def javaOpts = [
'-Dlog4j.configuration=log4j-cli.properties',
'-Xmx512M'
]
@chris-allan
chris-allan / annotations.py
Created May 23, 2014 10:50
Create OMERO annotations on an Image from the command line
#!/usr/bin/env python
# encoding: utf-8
"""
Create OMERO annotations on an Image from the command line
Copyright (C) 2014 Glencoe Software, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@chris-allan
chris-allan / server.py
Created July 1, 2014 15:35
Basic Flask-Security server with principals enabled
from flask import Flask
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import Security, MongoEngineUserDatastore, \
UserMixin, RoleMixin, login_required
from flask.ext.principal import Principal
# Create app
app = Flask(__name__)
app.config['DEBUG'] = True
@chris-allan
chris-allan / server.py
Last active September 19, 2024 12:20
Basic Flask-Security server with principals and MongoDB sessions
from flask import Flask
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import Security, MongoEngineUserDatastore, \
UserMixin, RoleMixin, login_required
from flask.ext.principal import Permission, RoleNeed
# Create app
app = Flask(__name__)
app.config['DEBUG'] = True
@chris-allan
chris-allan / setup.py
Created July 7, 2014 12:20
pytest plugin bug test case
"""
"""
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):