Skip to content

Instantly share code, notes, and snippets.

View shanmdphd's full-sized avatar
🎤
share for life

Sungpil Han shanmdphd

🎤
share for life
View GitHub Profile
@shanmdphd
shanmdphd / MRE-dose-tblNCA.R
Last active February 17, 2023 16:17
Minimal reproducible example: proper input of the `dose` argument in tblNCA function in NonCompart R package
library(dplyr)
library(NonCompart)
tblNCA(Theoph,
dose = Theoph %>%
mutate(actual_dose = Wt*Dose) %>%
select(Subject, actual_dose) %>%
unique() %>%
.$actual_dose)
@shanmdphd
shanmdphd / flatgs.sh
Last active September 11, 2017 05:33
Flatten PDFs with ghostscript (GS를 사용해서 PDF를 flattening할 수 있습니다. MacOS Sierra에서 테스트하였습니다.)
# http://zeroset.mnim.org/2015/01/07/flatten-pdfs-with-ghostscript/
# https://unix.stackexchange.com/questions/162922/is-there-a-way-to-flatten-a-pdf-image-from-the-command-line
# There should be `flat` sub-directory.
for file in *.pdf; do
gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \
-sColorConversionStrategy=/LeaveColorUnchanged \
-dAutoFilterColorImages=true \
-dAutoFilterGrayImages=true \
@shanmdphd
shanmdphd / fastBib.R
Last active September 8, 2017 02:46
Fast Bibliography Generation in R
knitr::write_bib(c('caffsim', 'NonCompart', 'ncar'), 'temp.bib')
capture.output(bibtex::read.bib('temp.bib'), file = 'temp.txt')
myBib <- readLines('temp.txt')
myBib[myBib == ''] <- '\n\n'
paste(gsub('_', '',myBib), collapse = '')
@shanmdphd
shanmdphd / my-reporters-setting.R
Created September 5, 2017 14:52
My favorite reporters setting
library(ReporteRs)
options('ReporteRs-fontsize' = 10)
potsub <- function(char) pot(char, textProperties(vertical.align = 'subscript'))
potsuper <- function(char) pot(char, textProperties(vertical.align = 'superscript'))
flexThis <- function(df){
df %>%
FlexTable(header.columns = TRUE) %>%
setFlexTableBorders(inner.vertical = mystyle$no, inner.horizontal = mystyle$std,
outer.vertical = mystyle$no, outer.horizontal = mystyle$big)
@shanmdphd
shanmdphd / ui.R
Created August 19, 2016 02:20
ui.R
library(shiny)
library(ggplot2)
dataset <- diamonds
fluidPage(
titlePanel("PEET2017"),
sidebarPanel(

깃 커밋 서명하는법

A. PGP key pair 등록

기존에 원래 사용하던 PGP key pair가 없을경우 새로 만들어야한다. 이미 key pair가 있을경우, 비밀키를 컴퓨터에 다운로드 해줘야한다.

A.1. 새 키 만드는법[^1]

$ gpg --generate-key
@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: