Skip to content

Instantly share code, notes, and snippets.

View jdblischak's full-sized avatar

John Blischak jdblischak

View GitHub Profile
@jdblischak
jdblischak / twitter-unfollowing.py
Created October 14, 2021 17:48
Unfollow all Twitter accounts that aren't following you back
#!/usr/bin/env python
# Unfollow all Twitter accounts that aren't following you back
#
# Twitter API:
# https://developer.twitter.com/en/docs/twitter-api
# https://github.com/python-twitter-tools/twitter
# https://developer.twitter.com/en/portal/projects/new
#
# Authentication:
@jdblischak
jdblischak / description-fields-reserved.txt
Last active June 17, 2021 15:05
R's DESCRIPTION fields documented in Writing R Extensions
Additional_repositories
Author
Authors@R
Biarch
BugReports
BuildVignettes
Built
ByteCompile
Classification/ACM
Classification/ACM-2012
calc3 <- function(sets)
{
sets <- check_sets(sets)
set_lengths <- vapply(sets, length, 0)
set_order <- order(set_lengths)
sets <- sets[set_order]
set_lengths <- set_lengths[set_order]
n_sets <- length(sets)
set_names <- names(sets)
@jdblischak
jdblischak / gpl-stats.R
Created July 26, 2019 16:12
Do CRAN packages that depend on the stats package use a copyleft license?
#!/usr/bin/env Rscript
# Do CRAN packages that depend on the stats package use a copyleft license?
# https://twitter.com/cimentadaj/status/1154420408508043264
Sys.Date()
## [1] "2019-07-26"
library(stringr)
@jdblischak
jdblischak / snake-group-meeting.py
Last active November 9, 2017 17:42
Example Snakefile for group meeting presentation
# Example Snakemake pipeline
#
# This example snakefile performs the following steps:
#
# * Downloads an Excel file
# * Converts the file to CSV format
# * Plots a result
# * Creates a summary report
#
# LICENSE: CC0. Do what you want with the code, but it has no guarantees.
@jdblischak
jdblischak / gh-pull-request.R
Created November 2, 2017 21:06
Create PR with R
#!/usr/bin/env Rscript
# This example code implements the fork and pull request workflow for GitHub
# directly from R using the packages gh and git2r. gh provides an R interface to
# the GitHub REST API v3, and git2r provides an R interface to libgit2. It
# submits the Pull Request to the practice repository Spoon-Knife.
#
# The following sequence of steps are performed:
#
# authenticate -> fork -> clone -> branch -> edit -> add -> commit -> push ->
@jdblischak
jdblischak / conda-forge-cran.R
Last active October 31, 2017 22:02
Helper script to identify conda-forge R packages that have more recent versions released on CRAN
#!/usr/bin/env conda-execute
# Helper script to identify conda-forge R packages that have more recent
# versions released on CRAN.
#
# Usage:
#
# conda execute conda-forge-cran.R
#
# or
@jdblischak
jdblischak / hgen-473-rna-seq.R
Last active September 6, 2022 15:34
RNA-seq analysis with R/Bioconductor
# HGEN 473 - Genomics
# Spring 2017
# Tuesday, May 9 & Thursday, May 11
#
# RNA-seq analysis with R/Bioconductor
#
# John Blischak
#
# Last updated: 2020-04-08
@jdblischak
jdblischak / Makefile
Last active September 5, 2023 20:29
Hide supplement but retain cross-referencing with LaTeX
NAME := main
all: $(NAME).pdf
%.pdf: %.tex
sed -i s/'\\includeonly'/'%\\includeonly'/ $(NAME).tex
pdflatex -shell-escape $(NAME)
# Insert additional calls to pdflatex or bibtex here,
# depending on the complexity of your document
@jdblischak
jdblischak / build-r.sh
Created December 1, 2016 16:10
Install local copy of R from source
#!/bin/bash
# Install local copy of R from source.
# To run:
# bash build-r.sh >& log.txt
# Version of R to install (must be part of the R 3.0 series)
VERSION=3.3.2
# Directory to install R. If not already present, creates bin, lib and share