Skip to content

Instantly share code, notes, and snippets.

View pawarvijay's full-sized avatar

vijay pawar pawarvijay

View GitHub Profile
@pawarvijay
pawarvijay / multiple_ssh_setting.md
Last active August 29, 2015 14:27 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@pawarvijay
pawarvijay / nginxproxy.md
Created December 18, 2016 13:06 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function bubbleSort(items) {
console.log(items);
var length = items.length;
for (var i = (length - 1); i >= 0; i--) {
//Number of passes
for (var j = (length - i); j > 0; j--) {
console.log('items[j] = ' + items[j] + ' items[j - 1] = ' + items[j - 1])
if (items[j] < items[j - 1]) {
//Swap the numbers
var tmp = items[j];
@pawarvijay
pawarvijay / Pythagorean Triplet In Javascript
Created April 25, 2017 08:25
Easiest Pythagorean Triplet In Javascript
https://www.youtube.com/watch?v=86YAPbZmsRI&index=1&list=LLk0ldD0HZK090snvfuKTSWw
var arraylist = [3, 1, 4, 6, 5 , 12 , 13];
arraylist.forEach(function(item,index){
if(item%2 === 0){
var divided = (item/2) * (item/2)
var big = divided + 1;
var small = divided - 1;
var foundSmall = false;
@pawarvijay
pawarvijay / Sort numbers without effecting alphabets - sort by selection sort
Created April 25, 2017 10:46
Sort numbers without effecting alphabets - sort by selection sort
function selectionSort(items)
{
console.log(items)
var length = items.length;
for (var i = 0; i < length - 1; i++)
{
@pawarvijay
pawarvijay / selectionsort.js
Last active April 25, 2017 12:51
Selection sort in javascript From geeksforgeeks.com
function selectionSort(items)
{
console.log(items)
var length = items.length;
for (var i = 0; i < length - 1; i++)
{
var min = i;
for (var j = i + 1; j < length; j++)
{
console.log('items[j] ' + items[j] + ' items[min] ' + items[min])
@pawarvijay
pawarvijay / Reverse an array without affecting special characters
Created April 25, 2017 13:09
Reverse an array without affecting special characters from geeksforgeeks.com
function isAlphabet(x)
{
return ( (x >= 'A' && x <= 'Z') ||
(x >= 'a' && x <= 'z') );
}
function reverse(str)
{
console.log('INPUT ARRAY ' + str.join(''))
@pawarvijay
pawarvijay / simple swap
Created April 25, 2017 13:18
simple swap in javascript
function reverse(str)
{
console.log('INPUT ARRAY ' + str.join(''))
var r = str.length - 1, l = 0;
while (l < r)
{
swap(l, r);
l++;
r--;