Skip to content

Instantly share code, notes, and snippets.

View gauravmehla's full-sized avatar
🚀
to the sky and beyond

Gaurav Mehla gauravmehla

🚀
to the sky and beyond
View GitHub Profile
@gauravmehla
gauravmehla / 0_reuse_code.js
Created December 6, 2016 06:07
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
@gauravmehla
gauravmehla / 5-ways-to-check-if-a-string-contains-a-substring-in-avascript.md
Created February 28, 2017 05:00 — forked from nepsilon/5-ways-to-check-if-a-string-contains-a-substring-in-avascript.md
5 ways to check if a string contains a substring in Javascript — First published in fullweb.io issue #89

5 ways to check if a string contains a substring in Javascript

1. ES6 .includes():

var S = "fullweb";
S.includes("web");

2. RegExp .search():

@gauravmehla
gauravmehla / IndianCities.json
Created March 27, 2017 08:46 — forked from shubhamjain/IndianCities.json
Indian States and their Cities
{
"AP":[
"Adilabad",
"Anantapur",
"Chittoor",
"Kakinada",
"Guntur",
"Hyderabad",
"Karimnagar",
"Khammam",
@gauravmehla
gauravmehla / IndianStates.json
Created March 27, 2017 08:47 — forked from shubhamjain/IndianStates.json
Indian States and Union Territories in JSON format
{
"AP":"Andhra Pradesh",
"AR":"Arunachal Pradesh",
"AS":"Assam",
"BR":"Bihar",
"CG":"Chhattisgarh",
"Chandigarh":"Chandigarh",
"DN":"Dadra and Nagar Haveli",
"DD":"Daman and Diu",
"DL":"Delhi",
@gauravmehla
gauravmehla / license-badges.md
Created June 16, 2017 05:49 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  
  • 🇫🇷 Cette liste en français
@gauravmehla
gauravmehla / ArrayIterate.js
Created June 16, 2017 07:14 — forked from NishiGaba/iterate-over-array.js
8 Methods to Iterate through Array
//8 Methods to Iterate through Array
//forEach (Do Operation for Each Item in the Array)
[1,2,3].forEach(function(item,index) {
console.log('item:',item,'index:',index);
});
//map (Translate/Map all Elements in an Array to Another Set of Values.)
const oneArray = [1,2,3];
const doubledArray = oneArray.map(function(item) {
@gauravmehla
gauravmehla / translate.js
Created June 28, 2017 12:09 — forked from mgechev/translate.js
Translate.js
var translate = (function () {
var symbols = {
a: '([]+![])[+!+[]]',
b: '([]+{})[+!+[]+!+[]]',
c: '([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]',
d: '([]+[][+[]])[+!+[]+!+[]]',
e: '([]+[][+[]])[+!+[]+!+[]+!+[]]',
f: '([]+[][+[]])[+!+[]+!+[]+!+[]+!+[]]',
g: '([]+([]+[])[([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]])[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]',
h: '(+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[])[([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+([]+[])[([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]
@gauravmehla
gauravmehla / how-to-use-mac-keychain-to-store-github-repos-credentials.md
Created July 18, 2017 07:02 — forked from nepsilon/how-to-use-mac-keychain-to-store-github-repos-credentials.md
How to use Mac KeyChain to store GitHub repos credentials? — First published in fullweb.io issue #108

How to use Mac KeyChain to store GitHub repos credentials?

You know the pain, you cloned a repo over HTTPS, and now Git asks you for your password each time you want to push or pull.

Chances are you already have the git credential-osxkeychain command installed. If not, just install Git with brew: brew install git.

Once installed, just tell Git to use the KeyChain to store your credentials:

git config --global credential.helper osxkeychain