Skip to content

Instantly share code, notes, and snippets.

@nelanka
nelanka / brew-setup.sh
Created December 14, 2016 00:47
Homebrew Setup
brew doctor
brew tap homebrew/dupes
brew update
brew upgrade
brew install findutils --with-default-names
brew install gnu-sed --with-default-names
brew install gnu-tar --with-default-names
brew install gnu-which --with-default-names
brew install gnu-indent --with-default-names
brew install gnutls --with-default-names
@nelanka
nelanka / ShardRegionGracefulShutdownExperiment.scala
Last active January 2, 2018 17:03
Shard Region Graceful Shutdown Experiment
package net.nelanka.akka_sandbox.cluster_sharding.experiments
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.language.postfixOps
import scala.util.{Failure, Success}
import akka.actor.{Actor, ActorRef, ActorSystem, FSM, Props, Terminated}
import akka.cluster.Cluster
import akka.cluster.sharding.ShardCoordinator.LeastShardAllocationStrategy
import org.json4s._
import org.json4s.native.JsonMethods._
val json: String = ???
println("Response: " + compact(render(json)))
@nelanka
nelanka / config.fish
Last active May 26, 2016 14:03
Fish Config
# Path to Oh My Fish install.
set -gx OMF_PATH "/Users/nelanka/.local/share/omf"
# Load oh-my-fish configuration.
source $OMF_PATH/init.fish
# vi mode
set fish_key_bindings fish_vi_key_bindings
# Helpers for changing directories
@nelanka
nelanka / fish.md
Last active May 26, 2016 13:56
Setup Fish Shell

Setup Fish Shell

Installation

  1. Install fish shell using Homebrew brew install fish
  2. Install Oh-My-Fish framework
curl -L https://github.com/oh-my-fish/oh-my-fish/raw/master/bin/install | fish
omf help
@nelanka
nelanka / ensime.md
Last active January 26, 2016 02:29
ENSIME Setup

Ensime Setup for Vim and Sublime Text 3

Add Ensime SBT plugin to sbt global plugins

mkdir ~/.sbt/0.13/plugins
echo 'addSbtPlugin("org.ensime" % "ensime-sbt" % "0.2.3")' >> ~/.sbt/0.13/plugins/plugins.sbt

Add Ensime Vim Plugin

@nelanka
nelanka / nelanka.zsh-theme
Last active August 24, 2016 22:45
My Zsh Theme
# ~/.oh-my-zsh/themes/nelanka.zsh-theme
# Nelanka's Oh My Zsh Theme
# Characters
SEGMENT_SEPARATOR="\ue0b0" # 
PLUSMINUS="\u00b1" # ±
BRANCH="\ue0a0" # 
DETACHED="\u27a6" # ➦
CROSS="\u2718" # ✘
LIGHTNING="\u26a1" # ⚡
@nelanka
nelanka / Vim.md
Last active January 24, 2016 22:42
Vim Commands
  • :e - Edit file (open)
  • :vs - Vertical split
  • :sb - Split buffer (horizontal)
  • :q - Close buffer
  • Ctrl+ww - Switch between windows
  • v - Start visual select. Move cursor to select.
@nelanka
nelanka / VundleSetup.md
Last active January 23, 2016 19:54
Vundle for Vim Setup

Vundle for Vim Setup

Vundle is a package manager for Vim. It lets you install things like Solarized colors and Airline easily.

Setup

  • Clear out or backup your ~/vim/bundle directory
  • Install Vundle: git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  • Add the following to the top of your ~/.vimrc to enable Vundle
@nelanka
nelanka / UsefulSublimePackages.md
Last active October 25, 2017 19:15
Sublime Packages and Setup

Sublime Packages and Setup

Icon

  • Find a replacement icon for Sublime Text. The FlatLand icon looks great.
  • Open the icon or image. Select all and copy to clipboard.
  • Go to the Applications folder and Apple-i on the Sublime Text app.
  • Select the app icon on the top left corner. A small select outline around the icon should appear.
  • Paste the new icon and save.
  • You can also right click on the SublimeText.app and click on "Show Package Contents". Navigate to the Contents/Resources folder and replace the icon that's in there with the new one.