Skip to content

Instantly share code, notes, and snippets.

View btskinner's full-sized avatar

Benjamin Skinner btskinner

View GitHub Profile
@btskinner
btskinner / make_emacs_app.sh
Created May 22, 2023 17:36
Script to make and move Emacs.app from homebrew emacs-mac to /Applications so that Spotlight can find it
#!/usr/bin/env bash
# Script to create Emacs.app that will be placed in Applications folder.
# This is cobbled together from two sources. All credit to them, unless it
# doesn't work, in which case, errors are my fault:
#
# (1) https://github.com/railwaycat/homebrew-emacsmacport/blob/master/docs/emacs-start-helpers.md
# (2) https://mathiasbynens.be/notes/shell-script-mac-apps
# You may need to make the script executable on your machine. In terminal
@btskinner
btskinner / config.el
Last active May 22, 2023 19:36
Doom emacs files
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; -- GENERAL SETTINGS ---------------------------------------------------------
;; identity
(setq user-full-name "Benjamin Skinner"
user-mail-address "btskinner@coe.ufl.edu")
;; fonts
(setq doom-font (font-spec :family "iA Writer Mono S" :size 16.0 :weight 'semi-light)
@btskinner
btskinner / mkv2mp4.sh
Last active January 7, 2022 19:49
Bash script to convert OBS *.mkv files to *.mp4 that work with Canvas LMS
#!/usr/bin/env bash
# 1. Save script as mkv2mp4.sh
# 2. chown +x mkv2mp4.sh
# 3. Use to convert default OBS *.mkv files to *.mp4 files that work with Canvas LMS
usage()
{
cat <<EOF
@btskinner
btskinner / .bashrc
Created January 20, 2020 18:30
Bash profile settings
# -------
# .bashrc
# -------
# fix colors
export TERM=xterm-256color
# add to path
export PATH="/usr/local/opt:/usr/local/opt/ruby/bin:$PATH"
@btskinner
btskinner / .Renviron
Last active May 3, 2023 03:35
Makevars and Renviron to use with Homebrew + OpenBLAS + OpenMP
# ---------
# .Renviron
# ---------
PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
@btskinner
btskinner / Makevars
Last active August 14, 2019 14:54
[OUTDATED] Build R with OpenBLAS and OpenMP support on MacOS 10.14 (Mojave)
# --------
# Makevars
# --------
# Homebrew bin / opt / lib locations
HB=/usr/local/bin
HO=/usr/local/opt
HL=/usr/local/lib
# ccache
@btskinner
btskinner / label_ipeds.r
Created July 20, 2018 14:49
Add variable / value labels to IPEDS data in R
################################################################################
##
## <PROJ> Add variable / value labels to IPEDS data in R
## <FILE> label_ipeds.r
## <AUTH> Benjamin Skinner @btskinner
## <INIT> 12 July 2018
##
################################################################################
## USAGE -----------------------------------------------------------------------
#!/bin/bash
# make_data.R
Rscript make_data.R
# analysis.do
stata -b analysis.do
# graphics.R
Rscript graphics.R
@btskinner
btskinner / reshape.R
Created April 7, 2017 13:55
Reshaping data in R
library(dplyr)
library(tidyr)
## make wide toy data
df <- data.frame(schid = c('A','B','C','D'),
year = 2013,
var_x = 1:4,
var_y = 5:8,
var_z = 9:12,
stringsAsFactors = FALSE) %>%
@btskinner
btskinner / fixbib.sh
Last active September 30, 2017 20:07
BibDesk to Jekyll scholar brace fix
#!/bin/bash
# PURPOSE
#
# To fix {{...}} used by BibDesk that don't play well with Jekyll scholar.
# Replaces {{...}} with "{...}". This respects capitalization and corporation
# names in the author field, but doesn't break Jekyll scholar.
#
# USAGE
#