Skip to content

Instantly share code, notes, and snippets.

@ilevantis
ilevantis / mfasta-sfasta awk command
Last active August 29, 2015 14:21
Split a multi fasta from uniprot into sensibly named indidvual entry fasta files
awk 'BEGIN{ FS = "|"}/>/{FS = "|"; filename = substr($3,1,12) }{print $0 > "<output-dir-path>" filename ".fa"}' <multi-fasta-2bsplit>
@ilevantis
ilevantis / useful_cmds
Last active August 29, 2015 14:21
Useful shell commands
## Delete files not matching "*.tex" :
```fish
find . -maxdepth 1 -type f ! -iname "*.tex" -delete
```
@ilevantis
ilevantis / parse_hmmer3.py
Created October 13, 2017 13:25
parse the txt output of hmmsearch (hmmer3)
#!/usr/bin/env python3
import re
from ast import literal_eval
import numpy as np
def parse_val(s):
try:
return literal_eval(s)
except:
@ilevantis
ilevantis / EvolDir-RSSifier.php
Created February 27, 2016 23:58
Turn EvolDir categories into RSS feeds
<?php
header('Content-Type: application/rss+xml; charset=UTF-8');
$list_name = htmlspecialchars($_GET['lname']);
$list_url = 'http://life.mcmaster.ca/cgi-bin/my_wrap/brian/evoldir/'.$list_name.'/';
$month_num = array (
"Jan" => 1,
"Feb" => 2,
@ilevantis
ilevantis / jira_points.tampermonkey.js
Last active October 13, 2021 08:12
Jira Point summary script for running in tampermonkey
// ==UserScript==
// @name Points for Jira
// @author mariotatis
// @namespace https://openuserjs.org/users/mariotatis/scripts
// @description Points for Jira cumulated story points and shows total points in each column
// @icon https://www.mariotatis.com/wp-content/uploads/2020/05/favicon-32x32-1.png
// @copyright 2020+, mariotatis.com
// @version 2.0.4
// @license MIT
// @grant none
@ilevantis
ilevantis / Mixcloud RSSifier
Last active February 15, 2024 08:38
Turn mixcloud streams into an RSS feed e.g. for mixcloud.com/<mixcloudstream>/playlists/<streamplaylist-if-there-is-one>/ go to mysite.com/mixcloud-rssifier/?fname=<mixcloudstream>&lname=<streamplaylist-if-there-is-one> to get an RSS feed of the stream or the playlist from the stream
<?php
header('Content-Type: application/rss+xml; charset=UTF-8');
// suck in the query string variables
$feed_name = htmlspecialchars($_GET['fname']);
$list_name = htmlspecialchars($_GET['lname']);
// compose the api urls + other stuff depending on presence of playlist
if(isset($_GET['lname'])) {
$json_url = 'http://api.mixcloud.com/'.$feed_name.'/playlists/'.$list_name.'/cloudcasts/';
@ilevantis
ilevantis / bedtools_cheatsheet.md
Last active April 10, 2024 19:12
Bedtools cheatsheet

Bedtools Cheatsheet

General:

Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.