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 / color-mixing-lamp.cpp
Created November 26, 2025 14:51 — forked from psychemist/color-mixing-lamp.cpp
Arduino Starter Project 4
// set up constants for input and output pins
const int redLEDPin = 9;
const int greenLEDPin = 10;
const int blueLEDPin = 11;
const int redSensorPin = A0;
const int greenSensorPin = A1;
const int blueSensorPin = A2;
// add variables for incoming sensor and output values
@kuang-da
kuang-da / ft_cell_type_markers.json
Last active December 10, 2025 05:56
CellTypeAnnotation
{
"Misc": {
"subtypes": {
"Extracellular Matrix": {
"markers": [
"Collagen IV"
],
"Anti_markers": [
"CD45",
"E-cadherin"
// TODO:: Define the path for exporting
def path = "/Users/kuangda/Developer/1-projects/hubmap/st-analysis/annotations/QuPath-Projects/annotation-export/Visium_13_44_S1.geojson"
// Get the current image data
def imageData = getCurrentImageData()
// Extract image dimensions
def server = imageData.getServer()
def width = server.getWidth()
def height = server.getHeight()
import geopandas as gpd
import json
from rasterio.features import rasterize
import numpy as np
import tifffile
import os
import glob
from pathlib import Path
import xml.etree.ElementTree as ET
import traceback
@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 August 16, 2024 15:24
[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 July 1, 2024 07:30
[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" \