Skip to content

Instantly share code, notes, and snippets.

View ferstar's full-sized avatar
🎯
Focusing

J. F. Zhang ferstar

🎯
Focusing
View GitHub Profile
@ferstar
ferstar / ip_mask.py
Created October 11, 2017 09:10
初学 Python ,求大佬指导个 Python 思路 https://www.v2ex.com/t/396718
import sys
def main(fp):
print('ip\tmask')
with open(fp, 'r') as fh:
for line in fh:
line_trim = line.strip()
if line_trim.startswith('ip address'):
lst = line_trim.split()
@ferstar
ferstar / deseq2-analysis-template.R
Created March 9, 2018 09:53 — forked from stephenturner/deseq2-analysis-template.R
Template for analysis with DESeq2
## RNA-seq analysis with DESeq2
## Stephen Turner, @genetics_blog
# RNA-seq data from GSE52202
# http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=gse52202. All patients with
# ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl")
# Import & pre-process ----------------------------------------------------
# Import data from featureCounts
@ferstar
ferstar / SimpleHTTPServerWithUpload.py
Last active June 12, 2019 08:48 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@ferstar
ferstar / upload_file_to_tmp_link.py
Last active July 12, 2022 04:17
Temporarily upload files to TMPLINK
@ferstar
ferstar / rm duplicate items.py
Last active February 26, 2020 15:04
code board
a_list = [
{"型号": 12, "重量": 16, "产地": 19, "审核人": 33},
{"型号": 22, "重量": 92, "产地": 87, "审核人": 34},
{"型号": 15, "重量": 27, "产地": 86, "审核人": 35},
{"型号": 71, "重量": 55, "产地": 21, "审核人": 36},
]
b_list = [
{"产地": 87, "型号": 22, "重量": 92, "审核人": 34},
{"产地": 86, "型号": 15, "重量": 27, "审核人": 35},
@ferstar
ferstar / delete_action_runs.py
Created January 7, 2022 01:25
Delete all workflow runs&artifacts of a github repo
import asyncio
import sys
from aiohttp import ClientSession, ClientTimeout
def seq_iter(seq, step=10):
if not seq:
return seq
from_idx, to_idx, seq_len = 0, step, len(seq)