Skip to content

Instantly share code, notes, and snippets.

View jchaffin's full-sized avatar

Jacob Chaffin jchaffin

View GitHub Profile
@jchaffin
jchaffin / noLTSInProductionWarning.js
Created June 20, 2017 12:39
warning user that currently node version is not designated for longterm support
let { config } = require('./config');
if (config.env === "production" && !process.release.lts) {
process.emitWarning('Running node version without lts in production', {
code: 'NO_LTS_IN_PRODUCTION',
detail: `Node.js version ${process.version} is not scheduled for long-term-support \
and may become unstable in the future.`.replace(/(\s{2,}(?!\b)|\t)/gm, '')
});
};
@jchaffin
jchaffin / splitPath.js
Created June 20, 2017 12:40
Splitting a relative path
function splitPath(...relPath) {
return relPath.reduce(
(a, b) => (/\.?\//).test(b) ? a.concat(b) : a.concat('/', b),
rootDir
)
};
@jchaffin
jchaffin / FTV-108-wk04.org
Last active January 6, 2019 11:12
Lecture notes from Film & TV Fall 2018 week 4

FTV 108 Week 04

Class 4A - American Documentary

Land Without Bread (1932)

  • With Vigo, Buñel adds another dimension to non-fiction film –- reflexive deconstruction of documentary process itself
  • This “reflexive” mode (Nichols) = ahead of its time, until postmodernist 1960s/1970s
  • Irreverent, proto-mockumentary style
@jchaffin
jchaffin / Makefile
Last active March 11, 2018 23:18
Makefile template for C++
x :=
CC :=g++
CXXFLAGS := -O3 -std=c++0x -pg -D_DEBUG -g -c -Wall
SRCDIR := src
BUILDDIR := build
BINDIR = bin
TARGET := $(BINDIR)/$(X)
SRCEXT := cpp
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
#!/usr/bin/python3
"""
Copyright 2017 Jacob Chaffin
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@jchaffin
jchaffin / EmacsKeyBinding.dict
Created January 6, 2019 08:03 — forked from jwreagor/EmacsKeyBinding.dict
Global Emacs Key Bindings for OS X
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
* BEWARE:
* This file uses the Option key as a meta key. This has the side-effect
* of overriding Mac OS keybindings for the option key, which generally
From eaa8362f684b0c9fad08d6452e53b26242d83b7d Mon Sep 17 00:00:00 2001
From: Jacob Chaffin <jchaffin@ucla.edu>
Date: Fri, 25 Jan 2019 21:01:09 -0800
Subject: [PATCH] Borderless frame on macOS Mojave
---
src/nsterm.m | 66 +++++++++-------------------------------------------
1 file changed, 11 insertions(+), 55 deletions(-)
diff --git a/src/nsterm.m b/src/nsterm.m
@jchaffin
jchaffin / org-ref.org
Created February 8, 2019 05:13
makeidx in middle of page
#+latex_header: \usepackage{makeidx}
#+latex_header: \makeindex
# This ridiculousness is to make the index start in the middle of a page.
# https://tex.stackexchange.com/questions/23870/index-shouldnt-start-new-page
#+latex_header: \makeatletter
#+latex_header: \renewenvironment{theindex}
#+latex_header: {\section*{\indexname}%
#+latex_header: \@mkboth{\MakeUppercase\indexname}%
#+latex_header: {\MakeUppercase\indexname}%
#+latex_header: \thispagestyle{plain}\parindent\z@
@jchaffin
jchaffin / counsel-extra.el
Created April 1, 2019 11:11
outline for counsel-ext library
;;; counsel-extra.el --- -*- coding: utf-8; lexical-binding: t -*-
;; Copyright © 2019, Jacob Chaffin, all rights reserved.
;; Version: 0.0.1
;; Author: Jacob Chaffin -- <jchaffin@ucla.edu>
;; URL: https://github.com/jchaffin/counsel-extras
;; Created: 1 April 2019
;; Keywords:
;; Package-Requires ((emacs "24.3") (ivy "0.11.0") (ht "2.2") (straight "1.0"))
@jchaffin
jchaffin / *Org Src notes.org[ bibtex ]*
Created April 2, 2019 04:22
Online (unpublished)
@online{baez/online,
author = {Baez, John C. and Lauda, Aaron D.},
title = {Higher-Dimensional Algebra V: 2-Groups},
date = {2004-10-27},
version = 3,
langid = {english},
langidopts = {variant=american},
eprinttype = {arxiv},
eprint = {math/0307200v3},
annotation = {An \texttt{online} reference from arXiv. Note the