go to drive where you want to install googledrive cd ~ then wget googledrive wget https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download then you will see a file like uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE now rename the above file to gdrive mv uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE gdrive assign file executing rights mv uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE gdrive install gdrive in usr folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up a SSL Cert from Comodo | |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo. | |
These are the steps I went through to set up an SSL cert. | |
Purchase the cert | |
Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You'll be asked for the content of the CSR file when ordering the certificate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function splicing(arr,howMany){ | |
arr.splice(0,howMany); | |
return arr; | |
} | |
splicing([2,3,4],2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function chunk(arr,size){ | |
var temp=[]; | |
for(var i=0; i<arr.length; i){ | |
temp.push(arr.slice(i,i+=size)); | |
} | |
return temp; | |
} | |
chunk(['a', 'b', 'c', 'd'], 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function truncate(str, num) { | |
if(str.length<=num) | |
return str; | |
if (num <= 3) | |
return str.substr(0,num) + "..."; | |
return str.substr(0,num-3) + "..."; | |
} | |
truncate("A-tisket a-tasket A green and yellow basket", 11); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function repeat(str, num) { | |
// repeat after me | |
var op =[]; | |
while(op.length <num){ | |
op.push(str); | |
} | |
return op.join(''); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//to check if a string ends with the specific target | |
function end(str, target) { | |
// "Never give up and good luck will find you." | |
// -- Falcor | |
if(str.substring((str.length-target.length),(str.length))==target){ | |
return true; | |
} | |
else{ | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function largestOfFour(arr) { | |
// You can do this! | |
var arr1=[]; | |
for(var i=0; i<arr.length; i++){ | |
var subArr=arr[i]; | |
var largest= Math.max.apply(Math,subArr); | |
arr1.push(largest); | |
} | |
return arr1; | |
} |