This file contains hidden or 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
YEAR ?= $(shell date +"%Y") | |
MONTH ?= $(shell date +"%m") | |
DAY ?= $(shell date +"%d") | |
export YEAR | |
export MONTH | |
export DAY | |
PREFIX ?= $(YEAR)/$(MONTH)/$(DAY) |
This file contains hidden or 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 python3 | |
from sys import stdin | |
import re | |
def label2path(msg: str): | |
''' | |
"[foo][bar] baz" -> "foo/bar: baz" | |
For commit messages rewriting |
This file contains hidden or 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
{ lib | |
, stdenv | |
, glib | |
, fetchurl | |
, jdk | |
, xorg | |
, wayland | |
, libpulseaudio | |
, libglvnd | |
, libGL |
This file contains hidden or 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
{ | |
"nodes": { | |
"flake-utils": { | |
"locked": { | |
"lastModified": 1667395993, | |
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", | |
"owner": "numtide", | |
"repo": "flake-utils", | |
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", | |
"type": "github" |
This file contains hidden or 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
test.asm: test | |
objdump -C -S $< > $@ | |
test: main.o pure.o | |
clang -flto=thin -O2 $^ -o $@ | |
%.o: %.c | |
clang -flto=thin -O2 $< -c -o $@ | |
.PHONY: clean |
This file contains hidden or 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 python3 | |
# Delete a branch and its traking remote branch | |
# Usage: ./delete_branch.py %{bname} | |
import sys | |
import subprocess | |
def callgitdelete(bname: str, remote: bool): | |
if remote: |
This file contains hidden or 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 python3 | |
# Assume that you have branches locally for submitting patches, with only one commit ahead. | |
# E.g | |
# * 0bc8d76f8055092e59ecbb33357f8f0012903024 (jump-threading-58812) [JT] check xor operand is exactly the same in processBranchOnXOR | |
# | * 5a5c481943f7d76e2f7dd1e06d45a88f99b8f946 (vp-expand-nostdv) [RISCV][VP] expand vp instrinscs if no +v feature | |
# |/ | |
# | * 65106e34c94723dbca44e1b6ebf8a1cc77744666 (vp-expand-redmul) [RISCV][VP] Support vp.reduce.mul by ExpandVectorPredication | |
# |/ |
This file contains hidden or 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 sh | |
set -e | |
MAIN_BRANCH=`git branch --show-current` | |
for pick_branch in "$@"; do | |
git checkout -b temp | |
git cherry-pick `git rev-parse ${pick_branch}` | |
git branch -M ${pick_branch} |
This file contains hidden or 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
# Preserve history | |
HISTFILE=~/.zsh_history | |
HISTSIZE=10000 | |
SAVEHIST=10000 | |
setopt inc_append_history share_history extended_history | |
# Documentation about opt: https://zsh.sourceforge.io/Doc/Release/Options.html | |
setopt correct | |
setopt autocd | |
setopt nomatch |
This file contains hidden or 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
#!/bin/bash | |
srv_ssl=${SRV_SSL:-'/srv/ssl'} | |
install_dir=${INSTALL_DIR:-"$srv_ssl/$cert_domain"} | |
certbot_home=${CERTBOT_HOME:-"$HOME/certbot"} | |
dns_dnspod_credentials=${DNS_DNSPOD_CREDENTIAL:-$HOME/secrets/dnspod/credentials.ini} | |
function request_cert { | |
cert_domain=${1:-'inclyc.cn'} | |
certbot certonly \ |