Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

some old scripts

  • Loading branch information...
commit 0c5383a24296f71e2a6c939422d11082dee84006 1 parent c9c8930
@cboettig authored
View
19 hpc-tests/mpi.sh
@@ -0,0 +1,19 @@
+#Use the current working directory
+#$ -cwd
+## use bash commands
+#$ -S /bin/bash
+## combine error and output files
+#$ -j y
+## Parallel for openmp:
+##$ -pe threaded 16
+## Launch parallel mpi threads
+#$ -pe mpi 16
+## Output file name
+#$ -o test.log
+## Name for queue job
+#$ -N test
+
+module load gcc openmpi R
+Rscript -e "source('~/.Rprofile'); library('knitr'); knit('parallel.Rmd')"
+
+
View
14 notebook/fix-tags.R
@@ -0,0 +1,14 @@
+files <- system("ls *.md", intern=TRUE)
+require(gsubfn)
+lapply(files, function(file){
+ content <- readLines(file)
+ yaml <- grep("^---$", content)
+ content[yaml[1]:yaml[2]] <- gsubfn("science-communication", "", content[yaml[1]:yaml[2]])
+ content[yaml[1]:yaml[2]] <- gsubfn("plugins", "site-configuration", content[yaml[1]:yaml[2]])
+ content[yaml[1]:yaml[2]] <- gsubfn("NIMBioS", "pdg-control", content[yaml[1]:yaml[2]])
+ content[yaml[1]:yaml[2]] <- gsubfn("model-choice", "pmc", content[yaml[1]:yaml[2]])
+ writeLines(content, file)
+})
+
+
+
View
20 notebook/localize_images.R
@@ -0,0 +1,20 @@
+fix <- function(txt){
+ paste("(/assets/figures/", txt, ")", sep="")
+}
+
+localimages <- function(files){
+ require(gsubfn)
+ lapply(files, function(file){
+
+ content <- readLines(file)
+ content <- gsubfn("\\(http://.*/assets/figures/(.*\\.png)\\)", fix, content)
+ writeLines(content, file)
+ })
+}
+
+
+
+
+files <- system("grep -l 'http://.*/assets/figures/.*\\.png' *.md", intern=TRUE)
+localimages(files)
+
View
7 notebook/rename_extension.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+for name in `ls *.markdown`
+ do
+ file_name=`echo $name | cut -d. -f1 | cut -d "_" -f 2-`
+ git mv $name $file_name.md
+done
Please sign in to comment.
Something went wrong with that request. Please try again.