Skip to content

Instantly share code, notes, and snippets.

View MitsuhaMiyamizu's full-sized avatar
🌴
On vacation

是夕流芳 MitsuhaMiyamizu

🌴
On vacation
  • Utopia Planitia, Mars.
View GitHub Profile
@dmbates
dmbates / SimpleGibbs.md
Last active May 27, 2021 01:37
Simple Gibbs sampler in Julia

The Gibbs sampler discussed on Darren Wilkinson's blog and also on Dirk Eddelbuettel's blog has been implemented in several languages, the first of which was R.

The task is to create a Gibbs sampler for the unscaled density

 f(x,y) = x x^2 \exp(-xy^2 - y^2 + 2y - 4x)

using the conditional distributions

 x|y \sim Gamma(3, y^2 +4)

y|x \sim Normal(\frac{1}{1+x}, \frac{1}{2(1+x)})

@davfre
davfre / bamfilter_oneliners.md
Last active February 24, 2024 01:23
SAM and BAM filtering oneliners
These code snippets have been tested on R 3.1.0 and Mac OS 10.9.3. They presumably do *not* work on R 2.X!
## Enter these commands in the Mac OS Terminal
# use faster vecLib library
cd /Library/Frameworks/R.framework/Resources/lib
ln -sf /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib libRblas.dylib
# return to default settings
cd /Library/Frameworks/R.framework/Resources/lib
@hussius
hussius / kallisto_setup.sh
Last active December 11, 2020 15:45
Kallisto setup
# Download Kallisto and sratools (the latter to be able to download from SRA)
wget https://github.com/pachterlab/kallisto/releases/download/v0.42.3/kallisto_mac-v0.42.3.tar.gz
tar zvxf kallisto_mac-v0.42.3.tar.gz
wget http://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.5.2/sratoolkit.2.5.2-mac64.tar.gz
tar zxvf sratoolkit.2.5.2-mac64.tar.gz
# Download and merge human cDNA and ncDNA files from Ensembl for the index.
wget ftp://ftp.ensembl.org/pub/current_fasta/homo_sapiens/cdna/Homo_sapiens.GRCh38.cdna.all.fa.gz
wget ftp://ftp.ensembl.org/pub/current_fasta/homo_sapiens/ncrna/Homo_sapiens.GRCh38.ncrna.fa.gz
cat Homo_sapiens.GRCh38.cdna.all.fa.gz Homo_sapiens.GRCh38.ncrna.fa.gz > Homo_sapiens.GRCh38.rna.fa.gz
@undirectlookable
undirectlookable / nginx_static_to_dynamic_modules.zh-cn.md
Created February 17, 2016 08:37
[译] NGINX - 将静态模块转换为动态模块

NGINX - 将静态模块转换为动态模块

翻译信息 原文:https://www.nginx.com/resources/wiki/extending/converting/ 时间:2016年02月17日 译者:@Undirectlookable

NGINX 从 1.9.11 版本起,引入了一个新的模块加载方式:动态加载。这意味着模块可以根据配置文件,在 NGINX 运行时动态的加载。同样,也可以通过修改配置文件然后 Reload NGINX 来卸载模块。

模块API对于静态模块和动态模块是一致的,但是 config 文件和编译方法略微不同。这篇文章将解释这些变化。

@phith0n
phith0n / php5.dockerfile
Last active May 19, 2021 12:40
分享自己用的两份Alpine-php-fpm的dockerfile
FROM alpine:3.3
MAINTAINER Didiet Noor <dnoor@kulina.id> (@lynxluna)
# Patch APK Mirror to YKode
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.3/main" > /etc/apk/repositories
ENV TIMEZONE Asia/Shanghai
ENV PHP_MEMORY_LIMIT 512M
ENV MAX_UPLOAD 50M
@blackgear
blackgear / build.sh
Last active December 27, 2016 03:14
TCP_CDG cong_control mod version via http://blog.csdn.net/dog250/article/details/53560304, TCP_BUGS cong_control via http://blog.csdn.net/dog250/article/details/53725236 . Ported from Linux 4.3 to Linux 4.9. This patch should be apply on Linux Kernel v4.9 tag.
# Tested on GCE Debian 8
git clone --depth=1 --branch=v4.9 https://github.com/torvalds/linux.git
cd linux
curl https://raw.githubusercontent.com/google/bbr/master/Documentation/config.gce > .config
# Edit .config by yourself, set CONFIG_TCP_CONG_CDG=y
vi .config
git apply tcp_cdg.patch
# or git apply tcp_bugs.patch
make deb-pkg
@kieranrcampbell
kieranrcampbell / voom_de.R
Created March 20, 2018 22:40
example differential expression with limma voom
library(limma)
library(tidyverse)
dge <- DGEList(counts(sce_de))
dge <- calcNormFactors(dge)
design <- model.matrix(~ (dbz_cluster_str == "Unknown"), colData(sce_de)) # Your design matrix here
v <- voom(dge, design, plot = TRUE)
@ujin5
ujin5 / exploit.html
Created June 24, 2019 00:03
Google CTF Quals 2019 Monochromatic
<html>
<pre id='log'></pre>
<script src="mojo_bindings.js"></script>
<script src="third_party/blink/public/mojom/blob/blob_registry.mojom.js"></script>
<script src="being_creator_interface.mojom.js"></script>
<script src="food_interface.mojom.js"></script>
<script src="dog_interface.mojom.js"></script>
<script src="person_interface.mojom.js"></script>
<script src="cat_interface.mojom.js"></script>
<script>
@inertia42
inertia42 / u2_update.py
Last active August 30, 2020 13:22
U2更新种子securekey(Transmission)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -1. 感谢tongyifan,本脚本由他的qBittorrent版本修改而来,项目地址 https://gist.github.com/tongyifan/83220b417cffdd23528860ee0c518d15
# 0. 免责:仅在本人的Transmission v2.94上测试通过,本人不承担任何责任
# 1. 安装依赖: pip3 install requests transmissionrpc
# 2. 修改代码开头的apikey和transmission_config
# 3. 运行: python3 u2_update.py
# 4. 中间有报错就再运行,直到显示找到0个未被更新的种子为止
# 5. 请勿手动中断脚本运行!