This file contains 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
# wolfpack modules required: hugfre/R/3.0.2 fabbus/aspera/3.1.1.70290 | |
ascpCMD <- "ascp -QT -l1000M -i /share/ClusterShare/software/contrib/fabbus/aspera/3.1.1.70290/asperaweb_id_dsa.putty" | |
library(SRAdb) | |
if (!file.exists("../SRAmetadb.sqlite")) db <- getSRAdbFile("../") else db <- "../SRAmetadb.sqlite" | |
con <- dbConnect(dbDriver("SQLite"), db) # load the SRA database | |
accession <- "SRP026604" | |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 TABLE log( | |
time TEXT TEXT, | |
account TEXT TEXT, | |
env_list TEXT, | |
gid TEXT, | |
grp TEXT, | |
job_name TEXT, | |
job_number TEXT, | |
jobshare TEXT, | |
mail_list TEXT, |
This file contains 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
library(rjson) | |
options(scipen=10000) | |
if (file.exists("IAMA.db")) file.remove("IAMA.db") | |
system("sqlite3 IAMA.db < IAMA_scraper.schema;") | |
while (TRUE) { | |
bigTab <- NULL | |
after <- "" | |
baseURL <- "http://www.reddit.com/r/iama/.json?sort=new&limit=100" |
This file contains 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
imguRupload <- function(filename, title=NULL, caption=NULL, name=basename(filename), apikey="4feb29d00face5bc1b9dae536e15c373") { | |
require(RCurl) | |
require(RJSONIO) | |
if (length(filename)>1) stop("'filename' must be length 1.") | |
if (!file.exists(filename)) stop(filename, "does not exist!") | |
params <- list(key=apikey, image=fileUpload(filename), name=filename) | |
if (!is.null(title)) params[["title"]] <- title | |
if (!is.null(caption)) params[["caption"]] <- caption | |
fromJSON(rawToChar(postForm("http://api.imgur.com/2/upload.json", .params=params)))$upload | |
} |
This file contains 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
imguRupload <- function(filename, title=NULL, caption=NULL, name=basename(filename), apikey="4feb29d00face5bc1b9dae536e15c373") { | |
require(RCurl) | |
require(RJSONIO) | |
if (length(filename)>1) stop("'filename' must be length 1.") | |
if (!file.exists(filename)) stop(filename, "does not exist!") | |
params <- list(key=apikey, image=fileUpload(filename), name=filename) | |
if (!is.null(title)) params[["title"]] <- title | |
if (!is.null(caption)) params[["caption"]] <- caption | |
fromJSON(rawToChar(postForm("http://api.imgur.com/2/upload.json", .params=params)))$upload | |
} |
This file contains 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
#!/usr/local/bin/Rscript | |
library(twitteR) | |
library(imguR) | |
sess <- initSession("clark_lab_linux", "password") | |
rstats <- searchTwitter("#rstats", sess, n=1000) | |
#filter out junk | |
rstats <- rstats[sapply(sapply(rstats, screenName), length)>0] | |
#make graph | |
posters <- sort(table(sapply(rstats, screenName)), decreasing=TRUE) |
This file contains 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 -e | |
if [[ ! -f "${1}" ]] ; then | |
echo "File $1 does not exist, aborting." | |
exit 1 | |
fi | |
# Replace double digit chromosomes first | |
cmd="sed" | |
for i in `seq 10 22` `seq 1 9` X Y; do | |
cmd="$cmd -e 's/chr$i/$i/g'" |
This file contains 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
#!/usr/bin/perl -w | |
# | |
# script for nagios notify via Jabber / Google Talk Instant Messaging | |
# using XMPP protocol and SASL PLAIN authentication. | |
# | |
# author: Andrew Elwell <A.Elwell@physics.gla.ac.uk> | |
# based on work by Thus0 <Thus0@free.fr> and David Cox | |
# | |
# released under the terms of the GNU General Public License v2 | |
# Copyright 2007 Andrew Elwell. |
This file contains 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
> 2:3 %in% 1:5 | |
[1] TRUE TRUE | |
> !2:3 %in% 1:5 | |
[1] FALSE FALSE |
OlderNewer