Skip to content

Instantly share code, notes, and snippets.

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

Kazuki Yoshida kaz-yos

💭
I may be slow to respond.
View GitHub Profile
#!/bin/bash
# Original from http://xenodium.com/trying-out-gccemacs-on-macos/index.html
set -o nounset
set -o errexit
# Configures Emacs for building native comp support
# http://akrl.sdf.org/gccemacs.html

Emacs 28 native-comp experiment

  • Reinstall regular gcc without libgccjit
# https:/stackoverflow.com/questions/9369519/reset-homebrew-formula/
# Revert to original gcc.rb
brew update-reset
# Check languages for the absence of jit
brew edit gcc
# Reinstall regular gcc
brew reinstall gcc
@kaz-yos
kaz-yos / emacs-debugger-mode-help.txt
Created March 4, 2020 10:24
Extract from M-x describe-mode for debugger-mode
Debugger mode defined in ‘debug.el’:
Mode for backtrace buffers, selected in debugger.
A line starts with ‘*’ if exiting that frame will call the debugger.
Type b or u to set or remove the ‘*’.
When in debugger due to frame being exited,
use the r command to override the value
being returned from that frame.

Table of Contents for Appendix in VanderWeele 2015

A.1. EXPLANATION AND MECHANISM –459

A.2. MEDIATION: INTRODUCTION AND REGRESSION-BASED APPROACHES –461

A.2.1. Definitions and Identification –461

A.2.2. Regression Methods for Direct and Indirect Effects –465

A.2.3. Equivalence of the Product and Difference Methods for a Continuous Outcome and for a Rare Binary Outcome –476

A.2.4. The Product Method as a Valid Test of the Presence of Any Mediated Effect –477

A.3. SENSITIVITY ANALYSIS FOR MEDIATION –478

A.3.1. Sensitivity Analysis for Unmeasured Confounding for Total Effects on the Difference Scale –478

library(openxlsx)
### tableone export helpers
### Turn tableone output matrix into tidyverse data_frame
tableone_mat_to_data_frame <- function(mat) {
bind_cols(data_frame(Variable = rownames(mat)),
as_data_frame(mat))
}
@kaz-yos
kaz-yos / emacs-lisp-macro.el
Created October 27, 2018 10:01
Emacs Lisp Macro Talk by Ruy Ley-Wild on Sep 18, 2018 at Boston Emacs Meetup
;; 2018 Sep 18
;; Emacs Meetup
;; Extensible MACroS
;; by Ruy Ley-Wild
(inert ;; programming vs metaprogramming
input data -program-> output data
42 -double-> 84
@kaz-yos
kaz-yos / tableone_partners_r_group.Rmd
Created July 19, 2018 13:34
Lightning talk at Partners R User Group Meeting on 2018-07-19
---
title: "tableone (Lightning talk at Partners R User Group Meeting)"
author: "Kazuki Yoshida"
date: "`r format(Sys.time(), '%Y-%m-%d')`"
output: html_document
---
```{r, message = FALSE, tidy = FALSE, echo = F}
## knitr configuration: http://yihui.name/knitr/options#chunk_options
library(knitr)
@kaz-yos
kaz-yos / mark-every-fifth-files.el
Created June 7, 2018 14:50
Mark every fifth files
(cl-loop
for str in (thread-last
(number-sequence 1 60)
(seq-filter (lambda (x) (zerop (% x 5))))
(seq-map (lambda (x) (concat "000" (number-to-string x))))
(seq-map (lambda (x) (substring x -3)))
(seq-map (lambda (x) (concat "raw" x))))
do (dired-mark-files-regexp str))
@kaz-yos
kaz-yos / default-company-backends.el
Created May 7, 2018 12:52
Default emacs company-mode backends
(defcustom company-backends `(;; Emacs Lisp
;; In newer versions of Emacs, company-capf is used instead.
,@(unless (version< "24.3.51" emacs-version)
(list 'company-elisp))
;; BBDB https://www.emacswiki.org/emacs/CategoryBbdb
company-bbdb
;; nxml-mode
;; In Emacs >= 26, company-capf is used instead.
,@(unless (version<= "26" emacs-version)
(list 'company-nxml))