Skip to content

Instantly share code, notes, and snippets.

@uarun
uarun / intellij.md
Last active February 26, 2024 06:57
Intellij IDEA - Cheat Sheet (aka useful shortcuts)

Intellij IDEA - Cheat Sheet (aka most useful shortcuts)

Note: Some of these keymapping are specific to IdeaVim plugin. If you don't use IdeaVim (what' wrong with you :)), I've tried to point out where they differ, but I could have missed a few

Coding Session

Parameter documentation for Method Calls

  • Ctrl-P - Popup parameter documentation for method calls
@uarun
uarun / delete_eaDir.sh
Created June 19, 2023 22:33
Delete Synology NAS @eadir directories
find . -name '@eaDir' -type d -print0 | xargs -0 rm -rfv
@uarun
uarun / 01_IncreaseReplicationFactor.md
Last active February 28, 2023 09:03
Increase replication factor for __consumer_offsets Kafka topic

Increasing replication factor for a topic

  1. Create a custom reassignment plan (see attached file inc-replication-factor.json). In this case we are going from replication factor of 1 to 3.

  2. Run Kafka partition reassignment script:

    kafka-reassign-partitions --zookeeper $ZOOKEEPER_CONNECT \
        --reassignment-json-file /home/liquidnt/inc-replication-factor.json  \
        --execute
    
  3. Verify if the assignment was successful

@uarun
uarun / zsh.md
Created August 17, 2012 03:11
Zsh Tips & Tricks

Zsh Tips and Tricks

Argument History

!*        # ... All parameters of the last command
!$        # ... Last parameter of the last command
!^        # ... First parameter of the last command
!:1       # ... First parameter of the last command

!-2:2 # ... Second parameter from 2 commands ago

@uarun
uarun / babun_tab_completion.md
Created September 3, 2018 23:20
Fix for Babun Tab completion

Babun Tab Completion

If babun tab completion stops working, then do the following:

$ cd
$ compinit
$ cp .zcompdump .zcompdump-$HOSTNAME-$ZSH_VERSION
@uarun
uarun / _Events.groovy
Created December 18, 2011 04:47
Disable plugin upgrade messages in Grails
//... Disable annoying plugin upgrade messages
def resolveDependenciesWasInteractive = false
eventResolveDependenciesStart = {
resolveDependenciesWasInteractive = isInteractive
isInteractive = false
}
eventResolveDependenciesEnd = {
isInteractive = resolveDependenciesWasInteractive
}
@uarun
uarun / version_conflicts_gradle.md
Created December 25, 2012 20:19
Resolving version conflicts in Gradle

Resolving Version Conflicts in Gradle

If one module has a dependency on version 1.1 of library X and another module on version 2.0 of the same library, gradle will use the latest version.

Failing a build on version conflict

To make gradle fail the build on encountering a conflict, we can do the following:

configurations.all {

resolutionStrategy {

@uarun
uarun / free_monads.md
Last active April 8, 2018 11:36
Free Monad Resources

Online Resources to Learn Free Monads

Videos

Composable application architecture with reasonably priced monads - Rúnar Bjarnason

Composable application architecture with reasonably priced monads

Programs as Values - Rob Norris

@uarun
uarun / filetype.vim
Created August 3, 2011 19:32
Gradle syntax highlighting in vim
# ~/.vim/filetype.vim
au BufNewFile,BufRead *.gradle setf groovy
@uarun
uarun / MacOS_RecoveryDisk.md
Last active December 28, 2017 05:37
How to Create a Mac OS Sierra Recovery Disk

MacOS (Sierra) Recovery Disk

Prerequisites

USB drive with atleast 5 GB of storage

Steps

  1. Download MacOS Sierra from the App Store (cancel out of the installation)
  2. Open Finder and navigate to Applications directory