Skip to content

Instantly share code, notes, and snippets.

View hexylena's full-sized avatar
🏳️‍⚧️
Unavailable

Helena hexylena

🏳️‍⚧️
Unavailable
View GitHub Profile
@hexylena
hexylena / test.tf
Created September 29, 2021 08:31
example copying iam secrets to github
provider "github" {
owner = "hexylena"
}
resource "github_actions_secret" "repo-name-ses-key" {
repository = "repo-name"
secret_name = "SES_ACCESS_KEY"
plaintext_value = "${aws_iam_access_key.amazon-ses.id}"
}
resource "github_actions_secret" "repo-name-ses-secret" {
@hexylena
hexylena / clean-deps.py
Created November 18, 2021 16:31
Cleanup ansible roles that don't match the expected version
import yaml
import subprocess
with open('requirements.yml', 'r') as handle:
desired = yaml.load(handle)
desired = {x.get('name', x['src']): x['version'] for x in desired}
if any([isinstance(v, int) or isinstance(v, float) for v in desired.values()]):
raise Exception("One of your values is a float! Please make it a string in the yaml file.")
#!/usr/bin/env python
# Author: Helena Rasche
# License: AGPL-3.0
import json
import requests
import yaml
import subprocess
with open('requirements.yml', 'r') as handle:
@hexylena
hexylena / logged-in.js
Created April 21, 2022 11:11
Testing logins with playwright to automate Galaxy things
const { chromium } = require('playwright-chromium');
const fs = require('fs');
(async () => {
const browser = await chromium.launch();
var contextOptions = {
ignoreHTTPSErrors: true,
}
fs.stat("state.json", (err, stats) => {
@hexylena
hexylena / Discover.py
Last active June 16, 2023 14:17
Autodiscover available functions based on docstrings and type annotations
def discover(self):
import inspect
TYPES = {
str: "string",
int: "integer",
}
functions = []
discovered = [x for x in inspect.getmembers(self) if not x[0].startswith('_') and x[0] != 'discover']
for (fn_name, fn) in discovered:
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
title,rating,runtime,imdb_rating,meta_score,genre,release_year,description,director,stars,votes,gross,img_src,type
Love Actually,R,135,7.6,55,"Comedy, Drama, Romance",2003,"Follows the lives of eight very different couples in dealing with their love lives in various loosely interrelated tales all set during a frantic month before Christmas in London, England.",Richard Curtis,"Hugh Grant, Martine McCutcheon, Liam Neeson, Laura Linney, ","517,283",$59.70M,"https://m.media-amazon.com/images/M/MV5BNThkNjgxNGQtOTIxMy00ZTFmLWIwMDItYzE5YzM3ZDMzNDE3XkEyXkFqcGdeQXVyMTUyNjc3NDQ4._V1_UY209_CR3,0,140,209_AL_.jpg",Movie
Home Alone,PG,103,7.7,63,"Comedy, Family",1990,"An eight-year-old troublemaker, mistakenly left home alone, must defend his home against a pair of burglars on Christmas Eve.",Chris Columbus,"Macaulay Culkin, Joe Pesci, Daniel Stern, John Heard, ","629,713",$285.76M,"https://m.media-amazon.com/images/M/MV5BMzFkM2YwOTQtYzk2Mi00N2VlLWE3NTItN2YwNDg1YmY0ZDNmXkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_UY209_CR0,0,140,209_A
@hexylena
hexylena / cite.py
Last active May 6, 2024 11:12
Replace \cite{10.1234/some-key} with actual citation, doi2bib must be installed.
#!/usr/bin/env python
# license: cc0/public domain
import re
import sys
import subprocess
input_file = sys.argv[1]
output_file = input_file.replace('.tex', '.bib')
with open(input_file, "r") as f:
@hexylena
hexylena / test.xml
Created October 15, 2024 09:34
testing tool(s) for galaxy
<?xml version="1.0"?>
<tool id="metadataFetch" name="Metadata" version="1.0" profile="16.04">
<description></description>
<command detect_errors="aggressive"><![CDATA[
echo "==tags==" >> $output;
#for tag in $input.tags:
echo "${tag.user_tname}" >> $output;
#end for