Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻

Yi Zhou y1zhou

👨‍💻
View GitHub Profile
@y1zhou
y1zhou / build_docker.sh
Created Jun 30, 2022
EasyConnect Docker build script for M1 Macs
View build_docker.sh
git clone -b thread_reuse https://github.com/hagb/docker-easyconnect.git
cd docker-easyconnect
git submodule update --init --recursive
docker image build -f Dockerfile.compile -t compile .
EC_VER=7.6.7 # 替换成需要的版本
DOCKER_USERNAME="your-name"
docker image build \
--build-arg EC_URL=$(cat ec_urls/${EC_VER}.txt) \
-t "${DOCKER_USERNAME}/docker-easyconnect:${EC_VER}-aarch64" \
@y1zhou
y1zhou / markdown.snippets
Last active Apr 30, 2021
RStudio Rmarkdown snippets
View markdown.snippets
# \begin{}...\end{}
snippet begin
\begin{${1:env}}
${2}
\end{$1}
# Align(ed)
snippet ali
\begin{align${1:ed}}
${2}
\end{align$1}
@y1zhou
y1zhou / yeast2human.py
Created Nov 9, 2020
Yeast gene symbols to human homologs
View yeast2human.py
import numpy as np
import pandas as pd
import requests
# Interested genes
df = pd.read_excel("yeast_genes.xlsx")
pom_genes = df["Schizosaccharomyces pombe"][
df["Schizosaccharomyces pombe"].notnull()
].tolist()
cer_genes = df["Saccharomyces cerevisiae"][
@y1zhou
y1zhou / index.algolia.json
Created Jun 26, 2020
Hugo template for generating json file for Algolia
View index.algolia.json
{{/* $index is an array of json objects that we'll submit to Algolia */}}
{{ $index := slice }}
{{ range site.RegularPages }}
{{ $page := . }}
{{/* Split long posts into 1000-word chunks for less noise in results */}}
{{ $chunked := slice }}
{{ $post_len := len .PlainWords }}
{{ range $i := (seq 0 1000 $post_len) }}
{{ $chunked = $chunked | append (delimit (first 1000 (after $i $page.PlainWords) ) " " ) }}
@y1zhou
y1zhou / user.js
Created Dec 5, 2019
Edge style smooth scrolling for FireFox
View user.js
pref("general.smoothScroll.mouseWheel.durationMinMS", 50);
pref("general.smoothScroll.mouseWheel.durationMaxMS", 150);
pref("general.smoothScroll.currentVelocityWeighting", 0);
pref("general.smoothScroll.stopDecelerationWeighting", 0.82);
pref("mousewheel.default.delta_multiplier_y", 200);
pref("mousewheel.min_line_scroll_amount", 25);
@y1zhou
y1zhou / bench.sh
Created Oct 26, 2018 — forked from TimothyYe/bench.sh
Bench test script
View bench.sh
#!/usr/bin/env bash
#
# Description: Auto test download & I/O speed script
#
# Copyright (C) 2015 - 2016 Teddysun <i@teddysun.com>
#
# Thanks: LookBack <admin@dwhd.org>
#
# URL: https://teddysun.com/444.html
#
View read_n_lines.py
from itertools import islice
def next_n_lines(file_opened, N):
return [x.strip() for x in islice(file_opened, N)]
with open("samplefile", 'r') as f:
x = ""
while x != []: