Skip to content

Instantly share code, notes, and snippets.

View balthild's full-sized avatar
😢
Depression

Balthild balthild

😢
Depression
View GitHub Profile
@balthild
balthild / fix_paren.py
Created November 7, 2022 02:49
A FontForge script that fixes position of CJK parentheses in FangZheng fonts.
move_chars = [
("([{", 150),
(")]}", -150),
("〈《「『【〔〖", 150),
("〉》」』】〕〗", -150),
]
keep_puncts_only = True
puncts = [
# 这个列表来自 xeCJK 文档
import {
ActiveVisit, Errors, FormDataConvertible, Inertia, Method, Page, PendingVisit, Progress,
VisitOptions,
} from '@inertiajs/inertia';
import { deepKeys, deleteProperty, getProperty, setProperty } from 'dot-prop';
import { produce } from 'immer';
import { identity, isEqual } from 'lodash-es';
import moment, { Moment } from 'moment';
import { SetStateAction, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { Path, PathValue } from 'util-types';
@balthild
balthild / Custom.xaml
Last active December 13, 2021 16:08
A theme for Flow Launcher
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#222222" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
@balthild
balthild / flagging_strategy.rfis
Last active May 7, 2020 06:39
Code files mentioned in the paper «Analyzing visibility function with AOFlagger».
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a strategy configuration file for the AOFlagger RFI
detector by André Offringa (offringa@gmail.com).
Created by AOFlagger 2.14.0 (2019-02-14)
-->
<rfi-strategy format-version="3.93" reader-version-required="3.93">
<action type="Strategy">
<children>
<action type="SetFlaggingAction">
<new-flagging>0</new-flagging>
package main
import (
"fmt"
"golang.org/x/image/webp"
"image/png"
"io/ioutil"
"os"
"path/filepath"
"strings"
@balthild
balthild / series.m
Last active November 1, 2018 08:23
Try implementing Taylor Series in expreduce
(* Higher order derivatives *)
Dn[expr_, {x_, n_}] := Nest[D[#, x]&, expr, n]
(* This function will not work until corywalker/expreduce#183 is fixed *)
TaylorSeries[exp_, {x_, p_, order_}] :=
Sum[(Dn[exp, {x, n}] /. x->p) * (x-p)^n / (n!), {n, 0, order}] + O[x-p]^(l+1)
@balthild
balthild / jupyter
Last active October 30, 2018 15:29
Jupyter Lab
server {
listen 443 ssl http2;
server_name jupyter.example.org;
ssl_certificate /etc/letsencrypt/live/jupyter.example.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/jupyter.example.org/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
add_header Strict-Transport-Security "max-age=31536000" always;
### Keybase proof
I hereby claim:
* I am balthild on github.
* I am balthild (https://keybase.io/balthild) on keybase.
* I have a public key whose fingerprint is C98A 963D 6DFD 9E39 8190 671F 1D25 3040 F806 868B
To claim this, I am signing this object:
@balthild
balthild / shadowsocks-libev.conf
Created July 23, 2017 09:34
Upstart configuration for shadowsocks-libev
description "shadowsocks-libev"
author "Max Lv <max.c.lv@gmail.com>"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
# normal exit -9999
env CONFIG="/usr/local/etc/shadowsocks-libev/config.json"
@balthild
balthild / .zshrc
Last active September 7, 2016 04:58
OS X zsh numpad for HASEE G7-i78172S1
# http://superuser.com/questions/742171/zsh-z-shell-numpad-numlock-doesnt-work
# Add it into ~/.zshrc
# Keypad
# 0 . Enter
bindkey -s "^[Op" "0"
bindkey -s "^[On" "."
bindkey -s "^[OM" "^M"
# 1 2 3
bindkey -s "^[Oq" "1"