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
wget -O /tmp/YaHei.Consolas.1.12.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uigroupcode/YaHei.Consolas.1.12.zip | |
unzip /tmp/YaHei.Consolas.1.12.zip | |
sudo mkdir -p /usr/share/fonts/consolas | |
sudo mv YaHei.Consolas.1.12.ttf /usr/share/fonts/consolas/ | |
sudo chmod 644 /usr/share/fonts/consolas/YaHei.Consolas.1.12.ttf | |
cd /usr/share/fonts/consolas | |
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv |
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
require(phangorn); | |
# check the monophyletic status of every genus in the tree `phy` | |
check_genus_monophyly <- function (phy) { | |
# get genera. assumes form: Genus_species_whatever | |
gens <- sort(unique(sub("_.*", "", phy$tip.label))); | |
n <- length(gens); | |
cat("Checking ", n, " genera for monophyly status.\n", sep=""); | |
# the number of descendant tips of the MRCA. preallocate for monotypic genera | |
ndec <- rep(1, n); |
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 | |
# report files greater than some size (default 100 MB) | |
# does so recursively starting at some dir (default pwd) | |
# to make executable, do: | |
# chmod +x find_large_files.sh | |
print_help () { | |
echo "Recursively find all files larger than some size" |
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
# extract subtree induced from a set of tips | |
subtree.induced <- function (phy, tip) { | |
if (!inherits(phy, "phylo")) { | |
stop("object \"phy\" is not of class \"phylo\""); | |
} | |
Ntip <- length(phy$tip.label); | |
# convert to indices if strings passed in | |
if (is.character(tip)) { | |
idx <- match(tip, phy$tip.label); |
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
setwd("~/rProgramming") | |
files.sources = list.files() | |
sapply(files.sources, source) |
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
## written by: | |
# Joseph W. Brown (josephwb, @j0sephwb) | |
# Klaus Schliep (KlausVigo, @Klaus_Schlp) | |
get_mrca_fast <- function(phy, tip) { | |
if (!inherits(phy, "phylo")) { | |
stop('object "phy" is not of class "phylo"'); | |
} | |
if (length(tip) < 2) { | |
return(NULL); | |
} |
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 | |
cd ~ | |
mkdir OpenTree | |
cd OpenTree/ | |
git clone https://github.com/mtholder/propinquity.git | |
echo '[opentree]' > ~/.opentree | |
echo "home = $PWD" >> ~/.opentree | |
echo 'peyotl = %(home)s/peyotl' >> ~/.opentree |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
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
// g++ -Wall getlineSafe.cpp -o getlineSafe -O | |
#include <string.h> | |
#include <iostream> | |
#include <fstream> | |
#include <cstdlib> | |
std::istream& getlineSafe(std::istream& is, std::string& t) { | |
t.clear(); |
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
# Create a scatterplot with any species as the data points. | |
# To choose your species, go here: http://phylopic.org/ , then enter the name of the spp you want. Click on the image and click 'thumbnail', click on the picture, and then copy the link in the address bar of your browser. It should end with 'thumb.png' Paste it in place of the link below. | |
library(TeachingDemos) | |
library(png) | |
# Paste a link to a png of your favourite animal here. This will be an aardvarkplot. Make sure it ends with .thumb.png. | |
# If it doesn't end with .thumb.png reread the instructions above and try again. | |
link = "http://phylopic.org/assets/images/submissions/cfee2dca-3767-46b8-8d03-bd8f46e79e9e.thumb.png" |
NewerOlder