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 / pymoduleversions.py
Created July 11, 2018 11:36
Print out important CellProfiler Python module versions
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Glencoe Software, Inc. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD
# License which accompanies this distribution. The full text of the license
# may be found at http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@chris-allan
chris-allan / plate-pixels-files.sh
Created June 5, 2018 11:07
Print out OMERO binary repository paths for Plate data
#!/bin/bash
# Prints out OMERO binary repository paths for data associated with a Plate
#
# Copyright (C) 2018 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
@chris-allan
chris-allan / test_annotation_speed.py
Last active September 18, 2015 13:33
Test performance of annotation queries
#!/usr/bin/env python
# encoding: utf-8
"""
Tests performance of various annotation queries.
Copyright (C) 2015 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 / showinf.py
Last active August 29, 2015 14:08
Jython version of some showinf functionality
#!/usr/bin/env jython
# encoding: utf-8
"""
Dumps a basic set of metadata for an image file using Bio-Formats.
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 / 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):
@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 / 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 / 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 / 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 / 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'
]