Skip to content

Commit 8db4182

Browse files
committed
misc
1 parent 61f62f3 commit 8db4182

8 files changed

Lines changed: 30 additions & 11 deletions

File tree

home/.config/git/ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.ccls-cache
2+
.ccls-root

home/.config/wezterm/wezterm.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
local wezterm = require 'wezterm'
2+
local config = {}
3+
4+
config.hide_tab_bar_if_only_one_tab = true
5+
config.harfbuzz_features = {"calt=0", "clig=0", "liga=0"}
6+
7+
return config

home/.modules/ruby/2.7.0

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#%Module
2-
prepend-path PATH $env(HOME)/.gem/ruby/2.7.0/bin
2+
prepend-path PATH $env(HOME)/.local/share/gem/ruby/3.1.0/bin

home/bin/chrome

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
/opt/google/chrome/chrome --disk-cache-dir=/dev/shm --user-data-dir=$HOME/.config/google-chrome --ozone-platform=wayland chrome://new-tab "$@"
2+
/opt/google/chrome/chrome --disk-cache-dir=/dev/shm --user-data-dir=$HOME/.config/google-chrome chrome://new-tab "$@"

home/bin/ff

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ from ipdb import set_trace as bp
66

77
def main():
88
ap = argparse.ArgumentParser()
9+
ap.add_argument('-b', '--build', default='/tmp/Debug', help='build directory')
910
ap.add_argument('-d', '--debug', type=int, default=-1, help='rr record the specified command')
1011
ap.add_argument('-r', '--run', type=int, default=-1, help='run the specified command')
1112
ap.add_argument('--release', action='store_true', help='use /tmp/Rel as the build directory')
@@ -17,7 +18,7 @@ def main():
1718
args.run = args.debug
1819

1920
home = os.path.expanduser('~')
20-
build_dir = '/tmp/Rel' if args.release else '/tmp/Debug'
21+
build_dir = '/tmp/Rel' if args.release else args.build
2122
os.environ["PATH"] = os.path.expanduser(build_dir + '/bin') + os.pathsep + os.environ['PATH']
2223

2324
# GNU binutils
@@ -37,11 +38,13 @@ def main():
3738
print('not exist', file=sys.stderr)
3839
return
3940
substs = sorted([
41+
('/p', lambda: os.path.relpath(dirname, cwd)),
4042
('/t', lambda: os.path.relpath(tmp, cwd)),
4143
# See llvm/utils/lit/lit/llvm/config.py
4244
('clang', lambda: 'clang'),
4345
('clang_cc1', lambda: f'clang -cc1 -internal-isystem {build_dir}/lib/clang/17/include -nostdsysteminc'),
4446
('errc_EACCES', lambda: '"Permission denied"'),
47+
('itanium_abi_triple', lambda: 'x86_64'),
4548
('llc_dwarf', lambda: 'llc'),
4649
# See lld/test/MachO/lit.local.cfg
4750
('lld', lambda: os.path.expanduser('ld64.lld -arch x86_64 -platform_version macos 10.0 11.0 -syslibroot ~/llvm/lld/test/MachO/Inputs/MacOSX.sdk')),
@@ -56,6 +59,7 @@ def main():
5659
with fh as f:
5760
for line in f.readlines():
5861
line = line.strip()
62+
if 'END.' in line: break
5963
match = re.search(r'RUN:[ \t]', line)
6064
if not match:
6165
last = ''

home/bin/genhdr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ headers = {
7373
'cstdint' => ['int64_t','uint64_t'],
7474
'cstdio' => ['printf','puts','scanf','gets'],
7575
'cctype' => ['isdigit','isalpha','isalnum'],
76-
'cstdlib' => ['abs','atoi','atof','malloc','rand'],
76+
'cstdlib' => ['abort','abs','atoi','atof','malloc','rand'],
7777
'cstring' => ['strchr', 'strlen','strstr', 'strcpy', 'memcpy', 'memcmp', 'memset', 'strcmp'],
7878
'ctime' => ['time'],
7979
'deque' => ['deque'],

home/bin/git-use

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/zsh
22
if [[ -z $1 ]]; then
3-
echo git use '$branch'
3+
echo git use $1
44
exit 1
55
fi
6-
branch=master
7-
[[ $PWD =~ llvm ]] && branch=main
8-
git rebase origin/$branch $1
6+
git rebase $(git rev-parse --abbrev-ref origin/HEAD) "$1"

home/bin/llvm-push

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
#!/bin/sh
2-
git pull --rebase origin main && git commit --amend --date=now --no-edit && git push origin HEAD:main && git fetch origin main:main && git rebase main && git checkout main
1+
#!/bin/zsh
2+
setopt local_options no_case_match
3+
branch=$(git branch --show-current)
4+
if [[ $(git log -1 --pretty=%B) =~ 'WIP|RFC' ]]; then
5+
echo wip, dont push
6+
exit 1
7+
fi
8+
9+
git pull --rebase origin main && git commit --amend --date=now --no-edit && git push origin HEAD:main && git fetch origin main:main && git switch main || exit 1
10+
[[ $branch != main ]] && git branch -D $branch

0 commit comments

Comments
 (0)