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
  1. Download gh tool:
    GH_VERSION=2.30.0
    GH_URL=https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz
    GH_DIR=/opt/conda/bin
    wget "${GH_URL}" -O - | tar xvzf - -C ${GH_DIR} gh_${GH_VERSION}_linux_amd64/bin/gh --strip-components=2
    After this step, gh is located in /opt/conda/bin/gh.
  2. Login to GitHub:
@syoh
syoh / README.md
Last active May 17, 2022 12:48
jupyter lab workspaces test

README

Hello would this work?

I hope this does

@syoh
syoh / README.md
Created May 16, 2022 22:19 — forked from jtpio/README.md
JupyterLab 3.2.9

JupyterLab 3.2.9 on Binder

Binder

Features

  • Real Time Collaboration enabled

rtc-demo

@syoh
syoh / getopt-parse.bash
Created February 4, 2022 08:07
getopt example
#!/bin/bash
# A small example program for using the new getopt(1) program.
# This program will only work with bash(1)
# An similar program using the tcsh(1) script language can be found
# as parse.tcsh
# Example input and output (from the bash prompt):
# ./parse.bash -a par1 'another arg' --c-long 'wow!*\?' -cmore -b " very long "
# Option a
@syoh
syoh / bootstrap.sh
Created May 5, 2020 18:59
bootstrap script
#!/bin/bash
OSNAME=$(grep '^ID=' /etc/os-release | cut -d'=' -f2)
USERNAME=$(echo $HOME | cut -d"/" -f3)
[[ $(echo $USERNAME | grep -c jovyan) != 0 ]] && ISJOVYAN=true || ISJOVYAN=false
[[ $(groups | grep -c sudo) != 0 ]] && ISSUDOER=true || ISSUDOER=false
[[ $WSL_DISTRO_NAME ]] && ISWSL=true || ISWSL=false
## [[ "$OSNAME" == "debian" ]] && ISDEBIAN=true || ISDEBIAN=false
@syoh
syoh / plotting_basemap_background.ipynb
Created April 27, 2020 01:20
geopandas-plotting/plotting_basemap_background.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@syoh
syoh / .bashrc
Last active April 21, 2020 15:02
enable-color-shell
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

Updates files to center-align jupyter book content.

Relevant files are,

  • _sass/components/_components.book__layout.scss
  • _layouts/default.html

Simple way to make the modification is append following lines to Makefile:

center-align:
@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 October 6, 2022 11:36
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