-
iTerm2
-
Command Line Tools
xcode-select –install
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
/* @settings | |
name: ⚙️ Blue Topaz (Aetherx Extras) | |
id: blue-topaz-theme-aetherx | |
settings: | |
- | |
id: atx-general | |
title: 1. General | |
description: General appearance settings | |
type: heading | |
level: 1 |
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
#' Print xaringan slides to PDF | |
#' | |
#' Prints xaringan slides to a PDF file, even complicated slides | |
#' with panelsets or other html widgets or advanced features. | |
#' Requires a local installation of Chrome. | |
#' | |
#' @param input Path to Rmd or html file of xaringan slides. | |
#' @param output_file The name of the output file. If using NULL then | |
#' the output filename will be based on filename for the input file. | |
#' If a filename is provided, a path to the output file can also be provided. |
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
#' @title bibtex_2academic | |
#' @description import publications from a bibtex file to a hugo-academic website | |
#' @author Lorenzo Busetto, phD (2017) <lbusett@gmail.com> | |
bibtex_2academic <- function(bibfile, | |
outfold, | |
abstract = FALSE, | |
overwrite = FALSE) { | |
require(RefManageR) |
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
warning("You probably don't want to use this `backstitch()` function.", | |
"\n It's hacky and there's a much better option in knitr called `purl()`.", | |
"\n More info at: `?knitr::purl`") | |
#' Backstitch an Rmd file to an R script | |
#' | |
#' Takes an Rmd file -- that would be converted with knitr::knit() -- and | |
#' "backstitches" it into an R script suitable for knitr::purl(). The output | |
#' file is the just the backstitched R script when `output_type = 'script'`, or | |
#' just the code chunks when `output_type = 'code'` (note that all inline code |
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
# Reference: https://svds.com/jupyter-notebook-best-practices-for-data-science/ | |
import os | |
from subprocess import check_call | |
def post_save(model, os_path, contents_manager): | |
"""post-save hook for converting notebooks to .py scripts""" | |
if model['type'] != 'notebook': | |
return # only do this for notebooks | |
d, fname = os.path.split(os_path) | |
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d) |
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
# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat | |
# Originally seen at http://spatial.ly/2014/08/population-lines/ | |
# So, this blew up on both Reddit and Twitter. Two bugs fixed (southern Spain was a mess, | |
# and some countries where missing -- measure twice, submit once, damnit), and two silly superflous lines removed after | |
# @hadleywickham pointed that out. Also, switched from geom_segment to geom_line. | |
# The result of the code below can be seen at http://imgur.com/ob8c8ph | |
library(tidyverse) |
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-package markdown-mode | |
:defer t | |
:commands (org-table-begin org-table-end orgtbl-mode) | |
:config | |
(progn | |
(require 'org-table) | |
(eval-when-compile | |
(require 'whitespace)) | |
(defun advice:org-table-align:markdown () |
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
# https://stackoverflow.com/questions/25191620/ | |
# creating-lowpass-filter-in-scipy-understanding-methods-and-units | |
import numpy as np | |
from scipy.signal import butter, lfilter, freqz | |
from matplotlib import pyplot as plt | |
def butter_lowpass(cutoff, fs, order=5): | |
nyq = 0.5 * fs |
NewerOlder