Skip to content

Instantly share code, notes, and snippets.

View kuang-da's full-sized avatar
🧬
Focusing

Da (Derek) Kuang kuang-da

🧬
Focusing
View GitHub Profile
@kuang-da
kuang-da / gitlab-ci.yml
Created November 27, 2021 23:35
[gitlab-ci]
default:
image: 'maven:3.8.1-openjdk-11'
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end"
DOCKER_IMAGE_TO_SCAN: hello-webapp:latest
# Cache the Maven repository so that each job does not have to download it.
cache:
@kuang-da
kuang-da / popos-nvidia-docker.md
Last active February 15, 2024 21:04
[Install nvidia-docker2 In Pop!_OS]#popos

Introduction

This gist is a note about install nvidia-docker in Pop!_OS 20.10. nvidia-docker is used to help docker containers compute on GPU.

The basic installcation is in Nvidia's offical documentation. But there are a few tweaks to make it work on Pop!_OS 20.10.

Setting up Docker

No surprise. Follow the offical documentaion should work.

Setting up NVIDIA Container Toolkit

@kuang-da
kuang-da / popos-fcitx5.md
Last active February 1, 2024 13:26
[PopOS 安装 fcitx5] #Linx

PopOS 安装 fcitx5

简介

Linux 的输入法跟 Windows 和 mac OS 相比略有些不同,主要在于多了一个输入法平台的概念,并且有很多的输入法可以选择,着实让人头晕。今天根据几篇博文,我以安装 fcitx 为主线,梳理了一下输入法的安装过程和遇到的问题。

输入法平台

在使用 Windows 和 mac OS 时,我们通常直接选择输入法,例如搜狗输入法,百度输入法。但是在 Linux 系统中我们第一步是选择输入法平台,不同的平台下有各自的输入法。目前市面上的输入法平台有三种 iBus, fcitx,fcitx5。我主要推荐 Fcitx5。

@kuang-da
kuang-da / docker-compose.yml
Created March 23, 2021 18:40
[Docker Template] #docker #template
version: "3.9"
services:
theia-server:
build: .
network_mode: host
ports:
- "3838:3838"
environment:
- PASSWORD=chad
volumes:
@kuang-da
kuang-da / outlines.tex
Created February 28, 2021 16:10
tex-nonparametrics
\subsection{Background}
\subsection{Assumption}
\subsection{Hypothesis}
@kuang-da
kuang-da / deployment.sh
Created February 25, 2021 23:28
[Depolyment]The scripts for deployment
#!/bin/bash
# Depolyment of lecture notes
# Copy all the notes into a single directory before pushing to GitHub
DIRECTORY=.
TARGET_DIR=all-notes
FILE_NAMES=("2-hypothesis-testing" \
"3-binomial-distribution" \
"4-sign-test-wilcoxon-signed-rank-test" \
"5-wilconxon-rank-sum-test-rs-test" \
@kuang-da
kuang-da / docker-basics.sh
Last active February 25, 2021 23:30
[Notes about Docker] A notes about Docker's usage #docker #linux
#----Introduction---------------
# A notes about Docker's basic usage
#-------------------------------
# check all current containers
docker container ls
docker ps
# First time to run it in front end
docker run -rm -p 8787:8787 -e PASSWORD=chad rocker/rstudio
@kuang-da
kuang-da / libreoffice.sh
Last active October 25, 2020 19:56
[Notes about CLT] Command Linux Tools Notes #Linux#CLT
# convert pptx to pdf in batch
libreoffice --headless --invisible --convert-to pdf *.ppt
@kuang-da
kuang-da / code-snippet.tex
Last active November 26, 2021 19:13
[Notes about LaTeX] Examples and common code snipets of LaTeX #LaTeX
% ---------Introduction ----------------
% This snept is used to organize some small examples for LaTeX package listings.
% Iistings is a greate package for formating code in PDF files.
% https://ctan.org/pkg/listings?lang=en
% -------------------------------------
\usepackage{listings}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Code Style
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lstset{
@kuang-da
kuang-da / ggplot-example.R
Last active October 25, 2020 20:19
[Notes about R] Common used code snippet for R programming #R #datascience
p <- ggplot()
p <- ggplot(data = k_suggest_df,
aes(x = k, y = median_kl, col = calc))
p <- p + geom_line()
p <- p + xlab("K")
p <- p + ylab("Median KL divergence (across all cells)")
p <- p + theme_bw(base_size = 8)
#p <- p + theme(legend.key.size = unit(3, "line"))
p <- p + theme(legend.position = "bottom")
p <- p + theme(legend.title = element_blank())