Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Powell stevepowell99

View GitHub Profile
View gist:8c5d59d3d1af13a3c1693f2358314e25
library(tidyverse)
library(readxl)
suppressMessages(library(dendextend))
library(d3heatmap)
data <- readxl::read_excel("Data.xlsx",range="A3:CU24",na="NK")
mat=data %>% select(-(1:3))
rownames(mat) <- data[1:21,1]
mat2 <- mat %>%
@stevepowell99
stevepowell99 / DiagrammeRanimate.r
Last active Aug 9, 2018
Hack to animate a series of DiagrammeR graphs.
View DiagrammeRanimate.r
# Animation not yet possible natively in DiagrammeR: https://github.com/rich-iannone/DiagrammeR/issues/8
# so this simple hack for Shiny is based on https://stackoverflow.com/questions/27194893/reset-animation-in-shiny-r-studio#27224900
library(shiny)
library(DiagrammeRsvg)
library(DiagrammeR)
ui <- (fluidPage(
# Application title
headerPanel("Diagrammer Animation"),
@stevepowell99
stevepowell99 / rfeed.xml
Last active May 16, 2016
Rss feed for tagged posts on blot.im; see http://stevepowell.blot.im/rfeed
View rfeed.xml
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>{{title}}</title>
<link>{{blogURL}}</link>
<description>The feed of updates on R to {{name}}'s blog.</description>
<updated>{{updated}}</updated>
<id>{{blogURL}}</id>
<author>
<name>{{name}}</name>
@stevepowell99
stevepowell99 / extractDivs.py
Created Jan 29, 2015
Goes through a pelican output folder and extracts just the article divs.
View extractDivs.py
#!/usr/bin/env python
import poppler, os.path, os, time, datetime
from bs4 import BeautifulSoup
g = open("./output/all.html","w")
x=""
@stevepowell99
stevepowell99 / extractAnnotations.py
Last active Nov 14, 2020
Extracts annotations and highlighted passages in all .pdf files in a folder recursively and outputs them as text files with the same name and modification date
View extractAnnotations.py
#!/usr/bin/env python
# see http://socialdatablog.com/extract-pdf-annotations.html
myxkfolder="/home/steve/xk/" #you need to set this to where you want your to-dos to appear
import poppler, os.path, os, time, datetime
for root, dirs, files in os.walk('./'):
for lpath in files:
You can’t perform that action at this time.