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 -S bash -c 'nix-shell --pure $0 -A env' | |
# Usage: | |
# 1. run directly to enter bash (inside venv): `./venv-py37.nix` | |
# 2. build a standalone executable: `nix bundle -f ./venv-py37.nix` #this not works yet since it cause nested `unshare -U` call | |
# 3. run bash with extra arguments: `nix run -f ./venv-py37.nix '' -- -c 'python --version'` | |
# More: | |
# 1. commit id of nixpkgs can be found here: https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=python3 | |
let |
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 python3 | |
phrases = ''' | |
; 希腊字母: 参考 https://en.wikipedia.org/wiki/Greek_alphabet | |
Alpha,1=Α | |
alpha,1=α | |
Nu,9=Ν | |
nu,9=ν | |
Beta,1=Β |
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
package tools; | |
import com.google.gson.*; | |
import com.google.gson.reflect.TypeToken; | |
import com.google.gson.stream.JsonReader; | |
import com.google.gson.stream.JsonToken; | |
import com.google.gson.stream.JsonWriter; | |
import io.vavr.collection.List; | |
import io.vavr.control.Option; | |
import java.io.IOException; |
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
hello | |
tab indent | |
space indent | |
tab indent with following space | |
space before tab | |
space at eol (trailing-space) | |
tab at eol (trailing-space) | |
blank at eof (also trailing-space) | |
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 nix-shell | |
#!nix-shell -i python --packages python311 python311Packages.pypdf2 | |
import PyPDF2 | |
def merge_pdfs(input_path_list: list[str], output_path: str): | |
pdfWriter = PyPDF2.PdfWriter() | |
for input_path in input_path_list: | |
pdf1 = PyPDF2.PdfReader(open(input_path, "rb")) |
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
{ | |
"files.trimTrailingWhitespace": true, | |
"python.languageServer": "Pylance", | |
"python.analysis.typeCheckingMode": "strict", | |
"python.analysis.diagnosticSeverityOverrides": { | |
"reportImportCycles": "warning", | |
"reportUnnecessaryComparison": "information", | |
"reportUnnecessaryIsInstance": "information", | |
"reportUnnecessaryContains": "information", | |
"reportUnusedImport": "information", |
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
; 搜狗输入法: 设置 -> 高级 -> 自定义短语设置 -> 直接编辑配置文件 | |
; 配置文件格式: <按键序列> "逗号" <位置> "等于号" <目标字符序列> | |
; 希腊字母: 参考 https://en.wikipedia.org/wiki/Greek_alphabet | |
Alpha,1=Α | |
alpha,1=α | |
Nu,9=Ν | |
nu,9=ν |
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 nix-shell | |
#! nix-shell shell.nix | |
{ pkgs ? import <nixpkgs> {} }: | |
(pkgs.buildFHSUserEnv { | |
name = "devbox"; | |
targetPkgs = pkgs: (with pkgs; [ | |
python38 | |
python38Packages.pip |
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
#NOTE: not working yet, need debuging | |
{pkgs ? import <nixpkgs> {}, ...}: | |
pkgs.stdenv.mkDerivation rec { | |
pname = "popo"; | |
version = "3.56.1"; | |
src = pkgs.fetchurl { | |
url = "https://popo.netease.com/file/popolinux/popo_${version}_amd64_ubuntu.deb"; |
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
{ | |
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | |
inputs.flake-utils.url = "github:numtide/flake-utils"; | |
outputs = { self, nixpkgs, flake-utils }: | |
flake-utils.lib.eachDefaultSystem (system: | |
let | |
pkgs = nixpkgs.legacyPackages.${system}; | |
hpkgs = pkgs.haskell.packages.ghc923; | |
in rec { |
NewerOlder