Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
@vsoch
vsoch / main.go
Last active October 13, 2021 04:12
Embedded fields in structs
View main.go
package main
import (
"fmt"
)
type Fruit struct {
Name string
Color string
}
View latex-jekyll-site.yaml
name: generate-site
on:
pull_request: []
push:
branches:
- "main"
jobs:
Update:
@vsoch
vsoch / singularity-hub-badge.md
Created April 26, 2021 18:45
How to generate the Singularity Hub Archive Badge!
@vsoch
vsoch / dinosaur.lp
Last active March 21, 2021 17:31
My first logic program - am I a dinosaur (requires clingo)
View dinosaur.lp
% clingo dinosaur.lp
% These are blanket facts, statements that each of these is living
% I think these are called atoms
living(vanessa).
living(fernando).
living(maria).
% This tells use size of arms for each living thing
armsize(vanessa, "small").
armsize(fernando, "large").
@vsoch
vsoch / decorators.py
Created December 3, 2020 20:01
An example for how to customize login-required (in this case, to use a session based token instead)
View decorators.py
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.shortcuts import render, resolve_url
from myapp.settings import cfg
from myapp import settings
from urllib.parse import urlparse
import uuid
def login_is_required(
@vsoch
vsoch / snakemake-debugging.sh
Created October 20, 2020 16:52
Snakemake Debugging on Google Cloud
View snakemake-debugging.sh
# This is a small script (that typically I copy paste) on a Google Cloud instance
# to set up an environment to mimic a worker. It includes installing snakemake,
# retrieving a package with the working directory (which typically has the
# version of snakemake I aim to develop or debug, and then interactively debugging
# or doing this.
sudo apt-get install -y wget bzip2 ca-certificates gnupg2 git
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo chown -R $USER /opt
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda
@vsoch
vsoch / gls.py
Last active September 2, 2020 18:50
Testing Google Life Sciences updated download / upload script (will be put into version control)
View gls.py
#!/usr/bin/env python
# This is a helper script for the Google Life Sciences instance to be able to:
# 1. download a blob from storage, which is required at the onset of the Snakemake
# gls.py download <bucket> <source> <destination>
# workflow step to obtain the working directory.
# 2. Upload logs back to storage (or some specified directory of files)
# gls.py save <bucket> <source-dir> <destination-dir>
# gls.py save <bucket> /google/logs/output source/logs
@vsoch
vsoch / Dockerfile
Last active August 25, 2020 22:14
Dolmades Files
View Dockerfile
FROM ubuntu:16.04
LABEL version="1.0"
ENTRYPOINT [ "/singularity" ]
RUN mkdir -p /APPS /PROFILES
RUN chmod 0777 /APPS /PROFILES
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get -y install wget less vim software-properties-common python3-software-properties apt-transport-https winbind
RUN wget https://dl.winehq.org/wine-builds/Release.key
@vsoch
vsoch / AIRFLOW_FEEDBACK.md
Last active January 22, 2020 19:01
Apache Airflow Feedback 1/22/2020
View AIRFLOW_FEEDBACK.md

Airflow Feedback

This is feedback about contribution to Apache Airflow.

Background

I first opened up a pull request in early March 2019 to add a Singularity operator to airflow. I am fairly experienced with Singularity (but not Airflow) so largely my strategy was to use an existing operator (Docker) as an example, and go from there. The interaction felt more controlled than usual because I was required to open a JIRA issue, but this wasn't terrible and is understandable for a larger community. A reviewer was very quick

@vsoch
vsoch / pull_request.sh
Last active November 20, 2019 17:02
A supporting script for a GitHub action to open a pull request
View pull_request.sh
#!/bin/bash
# Suggested by Github actions to be strict
# Taken from https://www.github.com/vsoch/pull-request-action
set -e
set -o pipefail
################################################################################
# Global Variables (we can't use GITHUB_ prefix)
################################################################################