Skip to content

Instantly share code, notes, and snippets.

View davan690's full-sized avatar
💭
I may be slow to respond.

Anthony R Davidson davan690

💭
I may be slow to respond.
View GitHub Profile
@davan690
davan690 / IndexNewBook.Rmd
Last active February 23, 2022 02:07
My simple bookdown project build files
---
title: "Book title"
site: bookdown::bookdown_site
output: bookdown::gitbook
#github-repo: username/repo
subtitle: "Sub info"
# bibliography: ["references.bib", "book.bib"]
---
# Summary {#summary}
@mbroedl
mbroedl / invert-citeproc.py
Created July 5, 2019 12:42
Inverse pandoc citeproc from docx to markdown
#!/bin/env python
'''
Due to changes made towards pandoc2, at the moment mostly only the inversion of (some) citations and re-wrapping of lines into somewhat semantic units.
I previously had some pandoc filters that also converted track changes to CriticMarkup, could accept or reject them, and merged comments to footnotes or html comments;
due to the change in pandoc filters they don't work at the moment, so that functionality is not used for now (but it is implemented in the script).
Usage:
@StevenMMortimer
StevenMMortimer / most-starred-r-packages.R
Last active March 8, 2024 22:06
Most Starred R Packages
# load packages & custom functions ---------------------------------------------
today_date <- Sys.Date()
from_date <- as.Date("2015-06-01")
to_date <- as.Date("2020-05-31")
library(tidyverse)
library(httr)
library(cranlogs)
library(ggrepel)
@msrose
msrose / combining-git-repositories.md
Last active May 18, 2024 16:40
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@staltz
staltz / introrx.md
Last active May 20, 2024 14:59
The introduction to Reactive Programming you've been missing
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 13, 2024 11:18
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@ramnathv
ramnathv / index.Rmd
Last active April 24, 2019 00:46
Two Column Layout
---
title : Two Column Layout
author : Ramnath Vaidyanathan
framework : io2012 # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : solarized_light #
--- .RAW
## Two Column Layout
@rossmounce
rossmounce / feeds.xml
Last active February 28, 2023 15:20
My OPML bundle of academic journal RSS feeds related to my interests (phylogenetics, palaeontology), split into 4 different thematic sections.
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Ross's academic journal RSS feed subscriptions</title>
</head>
<body>
<outline text="General Biology Journals" title="General Biology Journals">
<outline type="rss" text="BioEssays" title="BioEssays" xmlUrl="http://onlinelibrary.wiley.com/rss/journal/10.1002/(ISSN)1521-1878" htmlUrl="http://onlinelibrary.wiley.com/resolve/doi?DOI=10.1002%2F%28ISSN%291521-1878"/>
<outline type="rss" text="Biol J Linn Soc" title="Biol J Linn Soc" xmlUrl="http://onlinelibrary.wiley.com/rss/journal/10.1111/(ISSN)1095-8312" htmlUrl="http://onlinelibrary.wiley.com/resolve/doi?DOI=10.1111%2F%28ISSN%291095-8312"/>
@benbalter
benbalter / jekyll-drafts.md
Last active March 12, 2024 07:39
Example of using drafts in Jekyll

Let's say your Jekyll site's directory structure looks like:

|-- _config.yml
|-- _drafts/
|   |-- a-draft-post.md
|-- _layouts/
|   |-- default.html
|-- _posts/
| |-- 2013-05-10-a-published-post
@lamberta
lamberta / .emacs
Created October 27, 2009 21:29
using a git repo as a todo list
;;add to your .emacs
(defun git-commit-file-and-push (&optional commit-msg)
"Commit current file and push to git repository."
(interactive)
(if (null commit-msg)
(setq commit-msg (read-from-minibuffer "Commit message: ")))
(if (buffer-modified-p (current-buffer))
(if (y-or-n-p "Save modified buffer? ")
(save-buffer)))