Skip to content

Instantly share code, notes, and snippets.

@0ncorhynchus
0ncorhynchus / entrance
Last active October 4, 2020 04:27
a tiny command line argument parser
#!/bin/sh
#
# Usage:
# source entrance "arg1 arg2 arg3" $*
#
readonly program=$(basename $0)
readonly args=($1)
shift 1
@0ncorhynchus
0ncorhynchus / Makefile
Last active February 15, 2017 12:31
Give a submodule as an argument in Fortran code
FC = gfortran
%.mod: %.f90 %.o
@:
%.o: %.f90
$(COMPILE.f) $<
### PROJECT UNIQUE ###
#!/bin/bash
IFS=$'\t'
awk -F '\t' '{print $1 "\t" $4}' | while read -r line; do
set -- $line
id=$1
json=$2
metanetx=$(echo $json | jq -rM --unbuffered 'try (."MetaNetX (MNX) Equation" | .[] | .id) catch ""')
kegg=$(echo $json | jq -rM --unbuffered 'try (."KEGG Reaction" | .[] | .id) catch ""')
@0ncorhynchus
0ncorhynchus / output
Last active November 10, 2015 10:11
lattice hdf5 load
$ python test.py 2> /dev/null
update: 1.04434204102 [sec]
save: 0.781103849411 [sec]
load: 0.143770933151 [sec]
@0ncorhynchus
0ncorhynchus / csv2wikitable.py
Last active April 2, 2024 21:56
convert csv to wiki table
"""
Usage: python csv2wikitable.py csv_file
-----
input: csv format
output: wiki table format
"""
import sys
if __name__ == '__main__':
@0ncorhynchus
0ncorhynchus / InlineFrameHeightAdjust.html
Last active December 19, 2015 05:09
Inline Frame Height Adjustment from codepen
<div id="wrap">
<h1>Inline Frame Height Adjustment</h1>
<iframe id="frame" src="/"></iframe>
</div>
@0ncorhynchus
0ncorhynchus / electrophoresis.html
Last active December 17, 2015 19:29
A CodePen by 0ncorhynchus. Electrophoresis
<div id="header">
<a href="javascript:reset();">reset</a>
<a id="run" href="javascript:run();">run</a>
</div>
<div id="gel"></div>