Skip to content

Instantly share code, notes, and snippets.

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

Extract: jar xf <jar-file>

View contents: jar tf <jar-file>

Create:

  • All files in current folder: jar cf <new-file-name> .
  • Custom: jar cf [input file(s)]
" http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc
set nocompatible " use vim defaults
set scrolloff=3 " keep 3 lines when scrolling
set ai " set auto-indenting on for programming
set showcmd " display incomplete commands
set nobackup " do not keep a backup file
set number " show line numbers
set ruler " show the current row and column
@kamalbanga
kamalbanga / Useful.md
Last active August 29, 2015 14:09
Useful Commands

SBT

echo "deb http://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list

sudo apt-get update

sudo apt-get install sbt

Java

@kamalbanga
kamalbanga / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kamalbanga
kamalbanga / max.cpp
Created December 3, 2014 13:49
Max Difference of Numbers in an Array.
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
@kamalbanga
kamalbanga / compress.scala
Last active May 8, 2019 07:28
Zlib Compression in Scala
import scala.io._
import java.util.zip.{Inflater, Deflater}
import java.io.{File, FileOutputStream}
object App {
def compress(inData: Array[Byte]): Array[Byte] = {
var deflater: Deflater = new Deflater()
deflater.setInput(inData)
deflater.finish
@kamalbanga
kamalbanga / install.md
Last active August 29, 2015 14:13
Installation commands by Ajay the Ultimate.

SBT

echo "deb http://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list

sudo apt-get update

sudo apt-get install sbt

Java

@kamalbanga
kamalbanga / latency.txt
Last active August 29, 2015 14:19 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@kamalbanga
kamalbanga / most_frequent.sh
Created April 23, 2015 14:29
Doug Mcllroy's solution to "find n most frequent words in a file"
tr -cs A-Za-z '\n' |
tr A-Z a-z |
sort |
uniq -c |
sort -rn |
sed ${1}q