Skip to content

Instantly share code, notes, and snippets.

View arbaaz's full-sized avatar
🔥
Building an amazing product

Arbaaz arbaaz

🔥
Building an amazing product
View GitHub Profile
@arbaaz
arbaaz / india.c
Created September 30, 2014 18:18
Will print india map on console
#include<stdio.h>
int main()
{
int a,b,c;
int count = 1;
for (b = c = 10;
a = "- FIGURE?, UMKC,XYZHello Folks,\

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
fi
read -e -p "Redis version to be installed (change if needed) : " -i "2.8.2" VERSION
echo 'Installing redis v.'$VERSION' ... '
@arbaaz
arbaaz / es.sh
Last active August 29, 2015 14:07
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb
sudo dpkg -i elasticsearch-1.1.1.deb
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
[
{ "keys": ["j","j"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false },
{ "key": "setting.vintage_ctrl_keys" }
]
}
]
@arbaaz
arbaaz / Preferences.sublime-settings
Created November 12, 2014 16:20
Tinyowl Sublime settings
{
"font_size": 14.0,
"ignored_packages":
[
],
"tab_size": 2,
"translate_tabs_to_spaces": true
}
@arbaaz
arbaaz / tinyowl.yml
Created November 13, 2014 11:37
tinyowl.yml
# ~/.tmuxinator/tinyowl.yml
name: tinyowl
root: ~/
project_root: ~/rd/tinyowl.app/
# Optional tmux socket
# socket_name: foo
# Runs before everything. Use it to start daemons etc.
# pre: sudo /etc/rc.d/mysqld start
@arbaaz
arbaaz / getSetterJS
Created November 13, 2014 17:18
getSetterJs
this.importantString = funciton(val, undefined) {
if(val == undefined) {
return val;
}
else if(typeof val == String) {
_importantString = val;
}
};
@arbaaz
arbaaz / selectChangejs
Created November 19, 2014 20:01
Selection Change handler
selectChanged: function(e) {
if (typeof e.added === "undefined") {
//removed
console.log(e.removed.val);
} else {
//added
console.log(e.added.val);
}