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
# -*- coding: utf-8 -*- | |
""" | |
Anki Add-on: Progress Bar | |
Shows progress in the Reviewer in terms of passed cards per session. | |
Copyright: (c) Unknown author (nest0r/Ja-Dark?) 2017 | |
(c) SebastienGllmt 2017 <https://github.com/SebastienGllmt/> | |
(c) liuzikai 2018-2020 <https://github.com/liuzikai> | |
(c) Glutanimate 2017-2018 <https://glutanimate.com/> |
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
# from https://unix.stackexchange.com/a/740187/580914 | |
# add to your .bashrc: | |
## cdf -- cd to frequent directories | |
function cdf() { | |
# Use awk to extract the directories from the history, using null characters as the separator | |
DIRS=$(history | tr '\n' '\0' | awk -v RS='\0' '$2 == "cd" && !/\$DIR/ { $1=""; $2=""; sub("^[[:space:]]*", ""); print }' | grep -v -P -C 5 'cd.*$DIR' | sort | uniq -c | sort -rn | head -n 12 | awk '{$1=""; sub("^[[:space:]]*", ""); print }') | |
# Filter out directories that don't exist and parent directories | |
VALID_DIRS=() |
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
" Lua 跳转到函数定义 { | |
fun! GotoLuaFuncDifinition() | |
let w = expand("<cword>") | |
exec "Rg \\b" . l:w . "\\b" | |
exec "norm! gg" | |
let rr = search("| function\\>", 'c') | |
if !rr | |
exec "cclose" | |
echo "search FAILED for " . l:w | |
return |
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
" 清理 Lua 文件头多余的 local 赋值语句 TidyLuaHeadStatements { | |
fun! IsLuaLocalAssignStatement() | |
return getline(".") =~ '^local\s\+\S\+\s*=' | |
endfun | |
fun! IsNecessaryLuaAssignment() | |
let v1 = line('.') | |
silent! exe "norm! #" | |
let v2 = line('.') |
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
local M = {} | |
local BITS_PER_BYTE = 8 | |
local BYTES_PER_INT = string.packsize('j') | |
local BITS_PER_INT = BITS_PER_BYTE * BYTES_PER_INT | |
function M.get_bit(h, i) | |
local index = i // BITS_PER_INT | |
local v = h[index] | |
if not v then |
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
/* | |
* Created by C.J. Kimberlin | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2019 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
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
public static class SimpleCSVParser { | |
static List<List<string>> ParseCSV(string text) { | |
var list = new List<List<string>>(); | |
List<string> row = null; | |
var sb = new StringBuilder(); | |
int i = 0; | |
while (i < text.Length) { | |
var c = text[i++]; | |
if (c == '"') { |
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/python | |
import re | |
import sys | |
from subprocess import Popen, PIPE, STDOUT | |
def print_lines(tag, lines): | |
lines = str(lines).splitlines() | |
n = len(tag) | |
n += (4 - (n % 4)) % 4 |
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
nmap <silent> -we :silent !explorer /select,"%"<CR> | |
nmap <silent> -wr :!start cmd<CR> | |
nmap <silent> -nn :tabnew %<CR> | |
nmap <silent> zfc ggVG"+y | |
nmap <silent> zfv ggVG"+P |
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
"HYDRA : OPEN LR UI RES EDITOR { | |
nmap <C-k> yiw:silent !call-hydra.sh <C-r>"<CR> | |
"} |
NewerOlder