View build_docker.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" \ |
View generate_slideshow.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg \ | |
-framerate 1 \ | |
-pattern_type glob \ | |
-i '*.png' \ | |
-c:v libx264 \ | |
-vf 'pad=ceil(iw/2)*2:ceil(ih/2)*2' \ | |
-pix_fmt yuv420p \ | |
slideshow.mp4 |
View .pre-commit-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default_language_version: | |
python: python3 | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v4.4.0 | |
hooks: | |
# list of supported hooks: https://pre-commit.com/hooks.html | |
- id: trailing-whitespace | |
- id: end-of-file-fixer |
View markdown.snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# \begin{}...\end{} | |
snippet begin | |
\begin{${1:env}} | |
${2} | |
\end{$1} | |
# Align(ed) | |
snippet ali | |
\begin{align${1:ed}} | |
${2} | |
\end{align$1} |
View yeast2human.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"][ |
View index.algolia.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{/* $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) ) " " ) }} |
View user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
View bench.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 != []: |