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
# 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.
@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
#!/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' ... '

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

@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,\
@arbaaz
arbaaz / fib.py
Created August 29, 2014 06:58
Smallest Fibnocci code in python
def fib(n):
a,b=0,1
while a<n:
print a,
a,b=b,a+b
fib(20000000)
@arbaaz
arbaaz / ConsoleClosed
Created August 21, 2014 06:52
When the Console Is Closed
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
namespace TestTrapCtrlC
{
public class Program
(sqrt(​cos(​x))*​cos(​200*​x)+​sqrt(​abs(​x))-​0.7)*​(4-​x*​x)^​0.01, (x-​2.9)^​2-​1, (‑(4*​x))-​7, (‑(4*​x))-​7.1
@arbaaz
arbaaz / server.js
Created July 13, 2014 15:31
create a node server saying hello world
var http= require('http');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/plain'});
res.write("hey awesome boy\n");
res.end('hello world');
}).listen(1337,'127.0.0.1');
console.log('server running at http://127.0.0.1:1337/');
@arbaaz
arbaaz / filewatcher.cs
Created July 13, 2014 15:12
C# filewatcher
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace FileWatcher
{