This file contains hidden or 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
-ea | |
-server | |
-Xss256k | |
-Xms4G | |
-Xmx4G | |
-XX:+IgnoreUnrecognizedVMOptions | |
-XX:+UnlockExperimentalVMOptions | |
-XX:+HeapDumpOnOutOfMemoryError | |
-XX:-OmitStackTraceInFastThrow | |
-XX:-UseSerialGC |
This file contains hidden or 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
/** | |
* Starts collecting a flow when the lifecycle is started, and **cancels** the collection on stop. | |
* This is different from `lifecycleScope.launchWhenStarted { flow.collect{...} }`, in which case | |
* the coroutine is just suspended on stop. | |
*/ | |
inline fun <reified T> Flow<T>.collectWhileStarted( | |
lifecycleOwner: LifecycleOwner, | |
noinline action: suspend (T) -> Unit | |
) { | |
object : DefaultLifecycleObserver { |
This file contains hidden or 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
# Make sure to modify "-Xms", "Xmx", "CICompilerCount", and "ParallelGCThreads" according to your PC hardware configuration... | |
##################### | |
# Default VM Options | |
##################### | |
# default value is 128m | |
-Xms1024m | |
# default value is 750m | |
-Xmx4096m | |
# default value is 512m |
This file contains hidden or 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
/** | |
Create pagebreaks in exported Obsidian PDFs. | |
Example: | |
# Heading 1 | |
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | |
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, | |
when an unknown printer took a galley of type and scrambled it to make a type |
This file contains hidden or 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
#!/bin/bash | |
# ------------------------------------------------------------------------------------------------ | |
# Installs Ruby using rbenv/ruby-build - can be used multiple times, to install different versions | |
# | |
# Download and run locally: | |
# wget git.io/inst_ruby -O install_ruby.sh && chmod a+x install_ruby.sh | |
# ./install_ruby.sh 2.6.6 | |
# | |
# Run from the web: |
This file contains hidden or 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
set myBibFile to "/Users/zhope/Dropbox/Sundry/Library.bib" | |
if myBibFile exists then | |
set currentBibs to do shell script "/usr/local/bin/pandoc-citeproc --bib2json " & quoted form of myBibFile & " | /usr/local/bin/jq -r ' .[] | \"\\(.id)\"'" | |
set currentBibs to paragraphs of currentBibs | |
end if | |
set bibFile to POSIX file myBibFile | |
my write_to_file("", bibFile, true) |
This file contains hidden or 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
(* EXPORT SELECTED NOTES TO THE CLIPBOARD | |
(no longer) requires hackademic URL handler from github user smargh | |
entirely rewritten to take advantage of Skim's built-in templating | |
2019-03-10 by derickfay | |
*) | |
property LF : (ASCII character 10) |
This file contains hidden or 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
(* EXPORT ALL SKIM NOTES TO THE CLIPBOARD | |
(no longer) requires hackademic URL handler from github user smargh | |
entirely rewritten to take advantage of Skim's built-in templating | |
2016-06-26 by derickfay | |
2019-02-09 updated to group notes by color | |
*) | |
property LF : (ASCII character 10) |
This file contains hidden or 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
tell application "Bookends" | |
set theIDs to «event ToySRUID» "Selection" | |
repeat with theID in paragraphs of theIDs | |
tell front library window | |
try | |
set myRefs to (publication items whose id is theID) | |
set myItem to first item of myRefs | |
set thePath to path of attachment items of myItem |
This file contains hidden or 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
tell application "Bookends" | |
tell front library window | |
set theIDs to get id of publication items of group item "Unlinked Attachments" | |
repeat with theID in theIDs | |
try | |
set myRefs to (publication items whose id is theID) | |
set myItem to first item of myRefs | |
set {theKey, thePath, theAuthor, theEditor, theTitle} to {citekey, path of attachment items, authors, editors, title} of myItem | |
if theAuthor = "" then set theAuthor to theEditor | |
set theRIS to format myItem using "RIS.fmt" |
NewerOlder