Skip to content

Instantly share code, notes, and snippets.

View wuyanxin's full-sized avatar
🎯
Focusing

吴彦欣 wuyanxin

🎯
Focusing
View GitHub Profile
@tanbro
tanbro / 单机多用户 JupyterLab 环境搭建.md
Last active June 24, 2024 08:51
单机多用户 JupyterLab 环境搭建

单机多用户 JupyterLab 环境搭建

概述

在这篇短文中,我们记录了如何在使用 [Ubuntu][] 1804 LTS 操作系统的单台服务器上,建立用户隔离的 [JupyterLab][] Web 环境。

目标是:

  • 操作系统的用户可以各自不受干扰的使用独立的 [JupyterLab][]
  • 各个用户的 [Conda][] 环境可以自动的出现在 [JupyterLab][] 的 Kernel 列表中
@thrawn01
thrawn01 / main.go
Created December 3, 2018 20:34
etcd `concurrency.Election` example with connection interruption detection and initial leadership status reporting
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@apalala
apalala / bench.py
Last active November 6, 2023 01:45
A simple Python benchmark
from __future__ import print_function
from math import sin, cos, radians
import timeit
'''
A simple Python benchmark.
Results on an overclocked AMD FX-8150 Eight-Core CPU @ 3.0 GHz, and
an Intel Core i5-2410M CPU @ 2.30GHz.
@mjackson
mjackson / color-conversion-algorithms.js
Last active June 8, 2024 01:27
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation