This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RA, 2021-06-20 | |
import executing | |
import inspect | |
import sorcery | |
class Memo(dict): | |
""" | |
Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SOURCE: https://home.cc.umanitoba.ca/~psgendb/doc/spades/joblib3/hashing.py | |
""" | |
Fast cryptographic hash of Python objects, with a special case for fast | |
hashing of numpy arrays. | |
""" | |
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> | |
# Copyright (c) 2009 Gael Varoquaux | |
# License: BSD Style, 3 clauses. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% model_to_html(m) | |
% Usage: | |
% | |
% fid = fopen('model.html', 'wt'); | |
% fprintf(fid, evalc("model_to_html(sbioloadproject('model.sbproj').m1)")); | |
% fclose(fid); | |
% | |
% RA, 2021-05-22, The Unlicense | |
function model_to_html(m) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# From | |
# https://itsfoss.com/free-up-space-ubuntu-linux/ | |
# APT | |
sudo apt-get autoremove | |
sudo apt-get clean | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function x { | |
mv "$1" "$1.original.mp4" | |
ffmpeg -i "$1.original.mp4" -vcodec libx264 -crf 40 "$1" -vf scale=640:-1 -preset veryslow \ | |
&& mv "$1.original.mp4" "$1.done.mp4" | |
notify-send "$1 compression done." | |
} | |
# https://stackoverflow.com/questions/11003418/calling-shell-functions-with-xargs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
gnome-terminal | |
# Put in ~/.local/share/nautilus/scripts/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make PDF 2x1 for printing | |
pdftk $FILE cat 1-end output - | pdfjam --nup 2x1 --landscape --outfile /dev/stdout | pdfjam --angle=90 /dev/stdin --outfile /dev/stdout | okular - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RA, 2020-10-16 | |
""" | |
Visualization of the FDR and estimates by Benjamini-Hochberg and Storey-Tibshirani. | |
[1] Benjamini Y and Hochberg Y. | |
Controlling the false discovery rate: a practical | |
and powerful approach to multiple testing. | |
J R Statist Soc B, 1995. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 2020-HS Intro Bio Computers | |
% SimBiology first script -- modified to index names of species | |
% The trick | |
index_of = containers.Map(); | |
for i = 1 : length(BioComp_1.Species) | |
index_of(BioComp_1.Species(i).Name) = i; | |
end | |
clear AB; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display a PDF file in 2x1 portrait format for printing | |
pdfjam --nup 2x1 --landscape "file.pdf" --outfile /dev/stdout | \ | |
pdfjam --angle=90 /dev/stdin --outfile /dev/stdout | \ | |
okular - |