Skip to content

Instantly share code, notes, and snippets.

View syoh's full-sized avatar

Sang-Yun Oh syoh

  • University of California, Santa Barbara
  • Santa Barbara, CA, USA
View GitHub Profile
@syoh
syoh / package-development.md
Created February 8, 2020 16:46
Notes for R package development workflow

Package deveopment in R

This note is for myself from reading

usethis for automation

Many file creation and update can be accomplished with usethis. Some that I found useful are

@syoh
syoh / README.md
Last active January 5, 2025 21:17
Interfacing one C++ codebase with both Python and R

Interfacing one C++ codebase with both Python and R

Python

The input numpy array is mapped to the input of a C++ wrapper function using pybind11. Then, core function myfunc with templated input type is executed on the mapped matrix.

To execute the test function and profile memory usage, run

/usr/bin/time -v python test.py
% Encoding: UTF-8
@TechReport{AlzhimersAssociation2012,
author = {{Alzhimer's~Association},{}},
title = {Alzheimer's Disease: Facts and Figures},
institution = {Alzhimer's Association},
year = {2012},
file = {:papers/Association2012 - Alzheimer's Disease_ Facts and Figures.pdf:PDF},
groups = {Neuroscience, [syoh:]},
owner = {syoh},
@syoh
syoh / install-jupyter-rise-slideshow.sh
Last active April 18, 2019 18:17
Install and activate jupyter slideshow extension
#!/bin/bash
pip install rise
jupyter nbextension install rise --py --sys-prefix
pip install hide_code
jupyter nbextension install hide_code --py --sys-prefix
jupyter nbextension enable hide_code --py --sys-prefix
jupyter serverextension enable hide_code --py --sys-prefix
@syoh
syoh / install-jupyter-vim-binding.sh
Last active April 20, 2019 11:44
Install and activate jupyter-vim-binding
#!/bin/bash
mkdir -p $(jupyter --data-dir)/nbextensions
git clone https://github.com/lambdalisue/jupyter-vim-binding \
$(jupyter --data-dir)/nbextensions/vim_binding
jupyter nbextension enable vim_binding/vim_binding
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.