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
@ttesmer
ttesmer / AD.hs
Last active October 29, 2024 15:35
Automatic Differentiation in 38 lines of Haskell using Operator Overloading and Dual Numbers. Inspired by conal.net/papers/beautiful-differentiation
{-# LANGUAGE TypeSynonymInstances #-}
data Dual d = D Float d deriving Show
type Float' = Float
diff :: (Dual Float' -> Dual Float') -> Float -> Float'
diff f x = y'
where D y y' = f (D x 1)
class VectorSpace v where
zero :: v
@niw
niw / README.en.md
Last active October 24, 2024 03:04
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@jamesmacwhite
jamesmacwhite / README.md
Last active October 27, 2024 21:27
An example and overview of mwan3 IPv6 configuration with NAT6 (sorry anti IPv6 NAT people)

Deploying mwan3 with IPv6 (using NAT6)

I'm a user of mwan3 and contribute to its development in a small way by mainly providing feedback with my multi WAN setup and maintaining the beast of it's documentation on the OpenWrt wiki (feedback and contributors welcome).

This setup ultimately requires the use of a NAT6 firewall script. NAT6 is currently broke with fw3 and LuCI, so this is an important helper script to workaround this current limitation.

The NAT6 configuration requirements are explained in more detail on the OpenWrt wiki.

This gist is aims to document my configuration for others.

@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. 请勿手动中断脚本运行!
@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>
@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)
@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
@phith0n
phith0n / php5.dockerfile
Last active May 19, 2021 12:40
分享自己用的两份Alpine-php-fpm的dockerfile
FROM alpine:3.3
MAINTAINER Didiet Noor <[email protected]> (@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
@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 文件和编译方法略微不同。这篇文章将解释这些变化。

@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