This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlalchemy as sa | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import scoped_session, sessionmaker, relationship | |
from sqlalchemy.ext.hybrid import hybrid_property | |
from marshmallow_sqlalchemy import ModelSchema | |
engine = sa.create_engine('sqlite:///:memory:') | |
session = scoped_session(sessionmaker(bind=engine)) | |
Base = declarative_base() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlalchemy as sa | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import scoped_session, sessionmaker, relationship | |
from sqlalchemy.ext.hybrid import hybrid_property | |
from marshmallow_sqlalchemy import ModelSchema | |
engine = sa.create_engine('sqlite:///:memory:') | |
session = scoped_session(sessionmaker(bind=engine)) | |
Base = declarative_base() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from json import JSONEncoder | |
class JSONSetEncoder(JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, set): | |
return list(obj) | |
return JSONEncoder.default(self, obj) | |
json.dumps(thing_to_encode, cls=JSONSetEncoder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if grep -qs '/media/btrfs-root' /proc/mounts; then | |
echo "It's mounted" | |
else | |
mount /media/btrfs-root | |
fi | |
cd /media/btrfs-root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2014 Douglas Russell | |
# | |
# 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 3 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready(function() | |
{ | |
$('#webadmin_main_tabs a[href*="' + location.pathname.split("/")[2] + '"]').addClass('selected_admin_tab'); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#wmoore@jabber.lifesci.dundee.ac.uk | |
#What I do... | |
brew install hub | |
git submodule foreach hub remote add snoopycrimecop | |
git submodule foreach git fetch snoopycrimecop | |
Then each time I want to build…. | |
git fetch snoopycrimecop | |
git checkout develop-latest | |
git reset --hard snoopycrimecop/merge/develop/latest | |
git submodule foreach hub remote update snoopycrimecop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getAllObjects(conn, project_ids, dataset_ids, image_ids, screen_ids, | |
plate_ids): | |
""" | |
Given a list of containers and images, calculate all the descendants | |
and necessary siblings (for any filesets) | |
""" | |
#TODO Handle None inputs, maybe add defaults | |
params = omero.sys.ParametersI() | |
# params.addId(experimenter_id) | |
qs = conn.getQueryService() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from omero.gateway import BlitzGateway | |
from omero.sys import Parameters, ParametersI | |
from omero.model import * | |
from omero.rtypes import * | |
from omero import ValidationException | |
import ConfigParser | |
from omero.model import ExperimenterI, ProjectI, DatasetI, ImageI, \ | |
ScreenI, PlateI, \ | |
ProjectDatasetLinkI, DatasetImageLinkI, \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.fixture(scope='function') | |
def project_broken_multi(conn, request, itest, update_service): | |
# Create a project and dataset and link them | |
project1 = ProjectI() | |
project1.name = rstring(itest.uuid()) | |
dataset1 = DatasetI() | |
dataset1.name = rstring(itest.uuid()) | |
project1.linkDataset(dataset1) |
OlderNewer