Skip to content

Instantly share code, notes, and snippets.

@mrhanlon
mrhanlon / AccessibilitySandbox-ContentView.swift
Last active March 12, 2024 02:07
Regarding [this module](https://www.hackingwithswift.com/books/ios-swiftui/hiding-and-grouping-accessibility-data) from 100 Days of Swift UI, it appears that when using `Image(decorative: "foo")` VoiceOver is disabled for the component even if accessibility label/traits are added.
struct ContentView: View {
let pictures = [
"ales-krivec-15949",
"galina-n-189483",
"kevin-horstmann-141705",
"nicolas-tissot-335096"
]
let labels = [
"Tulips",

Mount the remote volume through whatever means. Example, sshfs:

sshfs -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa <remote_user>@host:/path/to/mount /path/to/mount

Stop the machine and add the new shared folder to the VirtualBox config.

docker-machine stop 
@mrhanlon
mrhanlon / Generate a MathCaptcha
Created May 9, 2014 21:32
Math Captcha for Java Portlets
private static final String[] NUMBERS = {"zero","one","two","three","four","five","six","seven","eight","nine","ten"};
private static final String[] OPERATIONS = {"+", "-", "&times;"};
private static final Random RAND = new Random(); // not high entropy, but not a big deal here
private Map<String,String> generateCaptcha(PortletSession session) {
Map<String,String> captcha = new HashMap<String, String>();
int first, second, third, op, pos, solution;
op = RAND.nextInt(OPERATIONS.length);
---
project:
type: Genomic
fields:
- label: Title
type: text
required: true
entities:
- type: material
id: specimen
@mrhanlon
mrhanlon / README.rst
Last active July 25, 2016 21:50
Testing linking metadata together via embedded relationships instead of associationIds.
@mrhanlon
mrhanlon / OR2016_Notes.md
Created June 20, 2016 16:00
OR2016 Braindump.

OR2016 Notes

Fedora 4 Workshop - 13 June

Welcome Keynote - 14 June - 9a

@mrhanlon
mrhanlon / index_meta.py
Last active February 21, 2016 02:21
Quick script to index metadata from Agave in ElasticSearch
#!/usr/bin/python
import sys
import requests
import json
from agavepy.agave import Agave
from django.contrib.auth import get_user_model
def index_metadata(username):
me = get_user_model().objects.get(username='')
@mrhanlon
mrhanlon / package.json
Last active February 5, 2016 22:36
Gets project information for jobs currently running on TACC Stampede, Lonestar, and Maverick
{
"name": "projects-running-jobs",
"version": "1.0.0",
"description": "",
"main": "projects-running-jobs.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
@mrhanlon
mrhanlon / box_testing.py
Created February 5, 2016 17:03
A script to bootstrap testing Box.com interactions for DesignSafe-CI
from boxsdk import OAuth2, Client
from django.contrib.auth import get_user_model
from django.conf import settings
from designsafe.apps.box_integration.models import BoxUserToken
from designsafe.apps.box_integration.tasks import *
username = '<username>'
user = get_user_model().objects.get(username=username)
token = BoxUserToken.objects.get(user=user)
@mrhanlon
mrhanlon / tomcat-pem-to-jks.sh
Last active October 29, 2015 18:36
Converts a PEM formatted TLS certificate to a PKCS12 formatted keystore, ready for import into a standard JKS formatted keystore.
#!/bin/bash
###
# tomcat-pem-to-jks.sh
# Converts a PEM formatted TLS certificate to a PKCS12 formatted keystore,
# ready for import into a standard JKS formatted keystore.
#
# Usage:
# tomcat-pem-to-jks.sh -k /path/to/server.key -c /path/to/cert.crt -i /path/to/intermediate.crt
###