Skip to content

Instantly share code, notes, and snippets.

View seandavi's full-sized avatar

Sean Davis seandavi

View GitHub Profile
@seandavi
seandavi / getPubMetrics.R
Last active January 26, 2020 17:52
Get RCR and citation metrics for a list of pubmed IDs from https://icite.od.nih.gov/analysis
#' Get publication metrics from iCite
#'
#' iCite is a tool to access a dashboard of bibliometrics for papers
#' associated with a portfolio. Users upload the PubMed IDs of articles
#' of interest (from SPIRES or PubMed), optionally grouping them for
#' comparison. iCite then displays the number of articles, articles per
#' year, citations per year, and Relative Citation Ratio (a field-normalized
#' metric that shows the citation impact of one or more articles relative
#' to the average NIH-funded paper). A range of years can be selected,
#' as well as article type (all, or only research articles), and individual
@pgrosu
pgrosu / Python_client_secrets.py
Created August 18, 2016 02:30
Python and R code examples (with results) using Google Genomics API and a client_secrets.json file
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
import oauth2client
from oauth2client import client
from oauth2client import tools
@eloypnd
eloypnd / dnsmasq_setup_osx.md
Last active July 4, 2025 01:04
wildcard DNS record on OS X in localhost development with dnsmasq

wildcard DNS in localhost development

$ brew install dnsmasq
   ...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
  • edit /usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
@mixxorz
mixxorz / graphene.py
Last active January 9, 2025 16:46
Get requested fields from ResolveInfo. Graphene python.
"""
MIT License
Copyright (c) 2018 Mitchel Cabuloy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@lindenb
lindenb / BamServer.java
Last active December 3, 2015 00:07
Setting up a jetty server for https://www.biostars.org/p/168197/
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.servlet.*;
public class BamServer {
public static void main(String[] args) throws Exception {
Server jettyServer = new Server(8080);
ServletContextHandler context = new ServletContextHandler();
context.setContextPath("/");
DefaultServlet servlet= new DefaultServlet();
@iMilnb
iMilnb / boto3_hands_on.md
Last active October 19, 2022 09:15
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@mtmorgan
mtmorgan / readKallisto.R
Last active December 4, 2017 11:51
read kallisto RNA-seq quantification into R / Bioconductor data structures
.require <-
function(pkg)
{
withCallingHandlers({
suppressPackageStartupMessages({
require(pkg, character.only=TRUE, quietly=TRUE)
})
}, warning=function(w) {
invokeRestart("muffleWarning")
}) || {
Install s3fs on Mac OS X
1 - Install Homebrew - http://brew.sh/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2 - Use Homebrew to install s3fs + dependencies
brew install s3fs
3 - Do some custom stuff. I only used the first step from here -> https://gist.github.com/fukayatsu/3910097
sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
@rmflight
rmflight / post-commit
Last active March 29, 2024 19:43
useful commit hooks for R package dev
#!/path/2/Rscript
# License: CC0 (just be nice and point others to where you got this)
# Author: Robert M Flight <[email protected]>, github.com/rmflight
#
# This is a post-commit hook that after a successful commit subsequently increments the package version in DESCRIPTION
# and commits that. Analogous to the pre-commit at https://gist.github.com/rmflight/8863882, but useful if you only have
# good reasons for not doing it on the pre-commit.
#
# To install it, simply copy this into the ".git/hooks/post-commit" file of your git repo, change /path/2/Rscript, and make