Skip to content

Instantly share code, notes, and snippets.


Vanessasaurus vsoch

View GitHub Profile
vsoch / index.php
Last active Aug 16, 2022
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
View index.php
header('Content-type: text/xml');
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
$feedName = "My Audio Feed";
$feedDesc = "Feed for the my audio files in some server folder";
vsoch /
Created Dec 3, 2020
An example for how to customize login-required (in this case, to use a session based token instead)
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 / main.go
Last active Oct 13, 2021
Embedded fields in structs
View main.go
package main
import (
type Fruit struct {
Name string
Color string
View latex-jekyll-site.yaml
name: generate-site
pull_request: []
- "main"
vsoch / Singularity
Last active Jun 28, 2021
A quick tutorial on how to generate a Singularity image with loadcaffee
View Singularity
Bootstrap: docker
From: ubuntu:16.04
. /torch/install/bin/torch-activate
exec /bin/bash
vsoch /
Created Apr 26, 2021
How to generate the Singularity Hub Archive Badge!
vsoch / vcademy_mutual_information.m
Last active Apr 5, 2021
Mutual Information for Image Registration: an example of why maximizing mutual information is preferable over minimizing the least sum of squares for aligning two images from different modality.
View vcademy_mutual_information.m
% Mutual Information
% This shows why mutual information is important for registration, more-so
% than another metric like the least sum of squares.
% VSoch July 2013
% First, let's read in two pickle images that we want to register
% Note - this is a picture I found on google search, and I transformed it in
% photoshop by moving it down and right, and then CONTROL+I to get the inverse
pickle1 = imread('pickle1.png');
pickle2 = imread('pickle2.png');
vsoch / dinosaur.lp
Last active Mar 21, 2021
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
% This tells use size of arms for each living thing
armsize(vanessa, "small").
armsize(fernando, "large").
from sklearn.externals import joblib
import time
import numpy
import pickle
bigarray = numpy.zeros([190,91,190])
bigarray = bigarray.flatten()
### Saving
vsoch /
Created Oct 20, 2020
Snakemake Debugging on Google Cloud
# 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
sudo chown -R $USER /opt
bash -b -p /opt/conda