Skip to content

Instantly share code, notes, and snippets.

View radekkozak's full-sized avatar

Radek Kozak radekkozak

  • BONE
  • Poland
View GitHub Profile
@mahmoudimus
mahmoudimus / idea-gcg1.vmoptions
Last active April 11, 2025 10:43
A running timeline of my IntelliJ on Steroids with GC tuning
-ea
-server
-Xss256k
-Xms4G
-Xmx4G
-XX:+IgnoreUnrecognizedVMOptions
-XX:+UnlockExperimentalVMOptions
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:-UseSerialGC
@gmk57
gmk57 / Sending events to UI.kt
Last active March 3, 2025 15:45
Sending events to UI with Channel/Flow + custom collector (see my first comment for reasons behind it)
/**
* 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 {
@HELWATANY
HELWATANY / Webstorm64.vmoptions
Last active May 15, 2025 02:39
JetBrains Custom VM Options Configuration Optimized For High Performance... Works with all JetBrains IDEs... JDK 8.x+ Recommended....
# 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
@liamcain
liamcain / obsidian-pagebreaks.css
Created November 8, 2020 01:04
Obsidian Pagebreaks
/**
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
@DaveThw
DaveThw / install_ruby.sh
Last active July 1, 2020 06:59 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby, using rbenv/ruby-build, on Ubuntu/Debian and derivatives
#!/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:
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)
@derickfay
derickfay / sk2c single note templated.applescript
Created March 9, 2019 23:49
Export selected Skim notes to the clipboard using native Skim templates
(* 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)
@derickfay
derickfay / export skim notes to markdown on clipboard sorting by color.applescript
Last active June 21, 2019 17:19
export skim notes to markdown on clipboard sorting by color.applescript
(* 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)
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
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"