Skip to content

Instantly share code, notes, and snippets.

View joshukraine's full-sized avatar
🏠
Working from home

Joshua Steele joshukraine

🏠
Working from home
View GitHub Profile
@joshukraine
joshukraine / syntime_re1.txt
Created January 27, 2018 07:47
Vim syntime report in a ruby file with regexpengine=1
TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN
0.057130 9929 4703 0.000084 0.000006 rubySymbol [[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@=
0.052588 7070 1844 0.000155 0.000007 rubySymbol []})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@=
0.050374 5257 31 0.000122 0.000010 rubyKeywordAsMethod \(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]
0.042170 5228 0 0.000079 0.000008 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`.*\)\@<=\n
0.040648 5228 0 0.000088 0.000008 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\>.*$\)\@<=\n
0.039729 5228 0 0.000071 0.000008 rubyString \%(^.*\%(\%(class\|::\)\s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'.*\)\@<=\n
0.039659 5228 0 0.000072
@joshukraine
joshukraine / zsh-error.txt
Last active May 3, 2020 05:47
Permissions error from zsh
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x 7 joshukraine admin 224 May 2 07:35 /usr/local/share/zsh
drwxrwxr-x 12 joshukraine admin 384 May 2 07:33 /usr/local/share/zsh/site-functions
[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.
[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
@joshukraine
joshukraine / obsidian-web-clipper.js
Last active February 3, 2023 09:08 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "obsidian-main";
/* Optional folder name such as "Clippings/" */
@joshukraine
joshukraine / vim-performance.md
Created May 20, 2023 10:13
What I’ve learned about slow performance in Vim

What I’ve learned about slow performance in Vim

January 27, 2018

I started this PR because Vim had gotten very slow and laggy. The problem seemed particularly painful when editing Ruby files. For example, when trying to move down by holding the “j” key, the downward motion would continue for a second or two after I’d released the key, causing me to far overshoot my target.

There were many other performance issues beyond scrolling. Sometimes even just simply typing in insert mode was noticeably slow. I knew things were getting serious when I found myself watching tutorial videos for Microsoft Visual Studio Code.

Happily, I’ve found a path back to a speedy and responsive Vim. Here’s what I’ve learned.