- Show live battery information of Mac and iOS device
coconut Battery
brew info coconutbattery
- Control volume slider each app
Background Music
brew info background-music
- pyl - Python Lex-Yacc
- pygments - Pythonic syntax highlighter for 300+ languages and text formats
- used by LaTeX package
minted
- structure
- List of default token types and their short names: https://github.com/pygments/pygments/blob/master/pygments/token.py
- used by LaTeX package
- linguist - blob languages detection used by GitHub
- known languages to GitHub
- grammars used by GitHub to do syntax highlighting
- test page
- cloc - count lines of code, in Perl
- Readme contains full manual
- Count lines of tex code:
cloc --force-lang=TeX,def --vcs=git
- Archive Extractor
extract.me
-
general
-
repositories https://github.com/microsoft/vscode https://github.com/microsoft/vscode-docs
- built-in extensions, including language grammars https://github.com/microsoft/vscode/tree/main/extensions
- release notes https://github.com/microsoft/vscode-docs/tree/main/release-notes/v1_86.md for v1.86
-
latex grammar https://github.com/jlelong/vscode-latex-basics imported by both vscode and
latex-workshop
extension https://github.com/microsoft/vscode/tree/main/extensions/latex https://github.com/James-Yu/LaTeX-Workshop/tree/master/syntax -
workspace cache stored in
~/Library/Application Support/Code/User/workspaceStorage/<32-length ID>
- cleanup cache per workspace run command "Workspaces: Cleanup Storage" from extension "Workspace Storage Cleanup" https://marketplace.visualstudio.com/items?itemName=mehyaa.workspace-storage-cleanup
-
commands (
Cmd + Shift + P
orCmd + P
then type in>
)- JSON: Sort Document
- provided by built-in extension JSON Language Features (source directory https://github.com/microsoft/vscode/tree/main/extensions/json-language-features)
- new in v1.76.0 https://code.visualstudio.com/updates/v1_76#_jsonc-document-sorting, added by microsoft/vscode#174352
- Debug: Start Debugging debug extension in a new window https://code.visualstudio.com/api/get-started/your-first-extension
- JSON: Sort Document
-
features
- Floating editor windows insiders only since v1.84 and generally available since v1.84 https://code.visualstudio.com/updates/v1_84#_floating-editor-windows https://code.visualstudio.com/updates/v1_85#_floating-editor-windows
-
CHANGELOG.txt https://texstudio-org.github.io/CHANGELOG.html https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/CHANGELOG.txt
-
Configure -> Commands
- Make "External PDF Viewer" respect additional PDF search paths (Configure -> Build)
open ?p{pdf}:ame" > /dev/null
also applies to "DVI Viewer" and "PS Viewer" https://texstudio-org.github.io/configuration.html#command-syntax-in-detail
- Make "External PDF Viewer" respect additional PDF search paths (Configure -> Build)
-
Magic comments https://texstudio-org.github.io/advanced.html#advanced-header-usage
%% switch engine % !TeX program = xelatex %% enable shell escape % !TeX TXS-program:compile = txs:///pdflatex/{%.tex} -shell-escape "%.tex" %% use -dev format % !TeX TXS-program:compile = pdflatex-dev -synctex=1 -interaction=nonstopmode %.tex %% use lualatex and enable shell escape %% would got Error "tput: No value for $TERM and no -T specified" without "TERM=xterm" setting % !TeX TXS-program:compile = sh -c "TERM=xterm lualatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex"
- about shell
All commands specified in the configuration (i.e. Commands and User Commands) are executed directly. There is no shell involved. So most shell functionality does not work. https://texstudio-org.github.io/configuration.html#shell-functionality
- about shell
Manually install an Atom package (ref):
git clone <package-repo>
cd package-name
apm install
apm link .
[Script Package] Change font size of output window (ref)
- Open config file
~/.atom/packages/script/styles/script.less
- Add property
font-size: 14px;
..script-view { // [...] .line { border-radius: 0px; margin: 0px; padding: 0px; font-size: 14px; // added here } }
Shortcuts
- Add line comment:
Esc-Ctrl-;
- Remove line comment:
Esc-Ctrl-=
Query settings:
MathJax config used by Typora for macOS, version 0.9.9.23.4 (2293).
/* /Applications/Typora.app/Contents/Resources/TypeMark/index.html */
<script type="text/x-mathjax-config" aria-hidden="true">
MathJax.Hub.Config({
skipStartupTypeset: true,
jax: ["input/TeX", "output/SVG"],
extensions: ["tex2jax.js", "toMathML.js"],
TeX: {
extensions: ["noUndefined.js", "autoload-all.js", "AMSmath.js", "AMSsymbols.js", "mediawiki-texvc.js"],
mhchem: { legacy: false }
},
/* more */
});
</script>
<script src="./lib/MathJax/MathJax.js" aria-hidden="true"></script>
Hashtag
- Clickable combination of a
#
and a word like#smile
showing in messages is called hashtag. - It is first introduced in March 2015, and can be used to bring order and structure into group chats.
- in
.tar.gz
tar -zxvf file.tar.gz
Item | Content |
---|---|
Preparation | install DjVuLibre, see brew info djvulibre |
Basic Usage | ddjvu -format=pdf [options] input.djvu output.pdf |
Useful option | -<n> -subsample=<n> , downsize n times; default 1, max 12 |
Doc | ddjvu 's man page |
Item | Content |
---|---|
Read Outline | djvused input.djvu -e 'print-outline' -u > outline.txt |
Write Outline | djvused -e 'set-outline outline.txt' -s input.djvu |
Doc | djvused 's man page |
Format of an outline
(bookmarks
("1 First chapter" "#10"
("1.1 First section" "#11"
("1.1.1 First subsection" "#12"))
("1.2 Second section" "#13"))
("2 Second chapter" "#14"
("2.1 First section" "#16")
("2.2 Second section" "#13")))
brew info qpdf
qpdf --check file.pdf
qpdf --qdf input.pdf - | fix-qdf > output.pdf
brew info mupdf
mutool clean -ad input.pdf output.pdf
doc: https://mupdf.readthedocs.io/en/latest/mutool-clean.html
brew info poppler
brew list poppler
pdfinfo # show pdf info
pdffonts # list used fonts in a pdf
pdfdetach # extract embedded files from pdf
pip3 install PyMuPDF
import fitz
doc = fitz.open('test.pdf')
toc = doc.getToC() # read outlines
# modify toc: List[List]
doc.setToC(toc) # write outlines
doc.saveIncr() # saves incrementally
Doc: https://pymupdf.readthedocs.io/en/latest/document.html
- ImageMagick
brew info imagemagick
- CLI options
-format <expr>
# show dpi
# - long form `-format '%[units] %[resolution.x],%[resolution.y]\n'`
$ identify -units PixelsPerInch -format '%U %x,%y\n' input.png
# change dpi
$ convert -density 300 -units PixelsPerInch input.png output.png
# use program ImageMagick
convert input.png -background white -alpha remove output.png
# make white transparent, allowing a 4% fuzz
# source: https://tex.stackexchange.com/a/611207
convert input.png -fuzz 4% -transparent "#ffffff" output.png
Doc for options -transparent color
and -fuzz distance{%}
.
https://imagemagick.org/script/compare.php
magick compare old.png new.png -highlight-color blue diff.png
- get video duration
https://superuser.com/a/945604 https://trac.ffmpeg.org/wiki/FFprobeTips#Duration
brew info ffmpeg ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -sexagesimal input.mp4 0:00:30.024000 # in form of HOURS:MM:SS.MICROSECONDS
Solution: Install the latest version by running brew install iandol/adobe-fonts/font-source-code-pro
The homebrew-cask-fonts
switched the source of Source Code Pro from adobe-fonts to google-fonts, while the latter decided to stop pulling from the former since newer versions don't have hinting. But adobe-fonts just removed SVG table from that font to support its use in browser since v2.032 ...
Longer story
- adobe-fonts/source-code-pro#250
- https://bugs.chromium.org/p/chromium/issues/detail?id=1100502
- https://bugzilla.mozilla.org/show_bug.cgi?id=1520157
- Homebrew/homebrew-cask-fonts#3973
Links
- https://github.com/adobe-fonts/source-code-pro/releases
- https://github.com/iandol/homebrew-adobe-fonts
Persist --console
setting in system-wide gradle.properties
file
- system-wide
gradle.properties
file is located in the path stored inGRADLE_USER_HOME
, which by default is~/.gradle
- add line
org.gradle.console=verbose
to$GRADLE_USER_HOME/gradle.properties
, after that runninggradle test
is equivalent togradle --console=verbose test
docs: