Skip to content

Instantly share code, notes, and snippets.

View akshaymittal143's full-sized avatar
🎯
Focusing

Akshay Mittal akshaymittal143

🎯
Focusing
  • Austin, Texas
View GitHub Profile

akshaymittal143

Keybase proof

I hereby claim:

  • I am akshaymittal143 on github.
  • I am akshaymittal143 (https://keybase.io/akshaymittal143) on keybase.
  • I have a public key ASDQVxUV8nIBoTjNpcCcb2j9dZrxhW0WPwoRNmvvC7n7xAo

To claim this, I am signing this object:

npx npm-check-updates -u
@akshaymittal143
akshaymittal143 / gist:6bacfb0309332d14fd31c304780da125
Created June 9, 2020 21:30
git pull all nested repo from the base dir
add this into `.bash_profile`
alias git-pull-all="find . -maxdepth 3 -name .git -type d | rev | cut -c 6- | rev | xargs -I {} git -C {} pull"
static String longestEvenWord(String sentence) {
//splitting words by space
String words[] = sentence.split(" ");
//sorting descending
Arrays.sort(words, (b, a)->Integer.compare(a.length(), b.length()));
for(String word: words) {
if(word.length() % 2 == 0) {
@akshaymittal143
akshaymittal143 / movies.js
Created October 6, 2018 19:41
getMovies title
const https = require('https');
/*
* Complete the function below.
* Use console.log to print the result, you should not return from the function.
*/
function getMovieTitles(substr) {
pageNum = 1;
let url = 'https://jsonmock.hackerrank.com/api/movies/search/?Title=' + substr + "&page=" + pageNum;
https.get(url, (res) => {
res.setEncoding('utf8');
@akshaymittal143
akshaymittal143 / proxy.conf.json
Created August 20, 2018 19:42
ng6 proxy.conf.json for spring boot
{
"/server": {
"target": "http://localhost:8080",
"secure": false,
"changeOrigin": true,
"logLevel": "debug",
"pathRewrite": {
"^/server" : ""
}
}
@akshaymittal143
akshaymittal143 / docker-compose.txt
Last active August 20, 2018 02:59
Install docker-compose
# Install docker-compose
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1`
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
@akshaymittal143
akshaymittal143 / gcp-cheatsheet.md
Last active July 17, 2018 16:45
gcp_cheatsheet

GCP Cheatsheet:

Basic commands:

  • gcloud projects list

  • gcloud init

  • gcloud components update

  • gcloud components install COMPONENT_ID

@akshaymittal143
akshaymittal143 / gist:7167665ec72cbe9d443f7d9250aa99fc
Created October 10, 2017 01:30
Quick Setup for setting Git project
It is recommended that every repository include a README, LICENSE, and .gitignore.
# create a new repository on the command line
* echo "# Angular-First-Project" >> README.md
* git init
* git add README.md
* git commit -m "first commit"
* git remote add origin https://github.com/akshaymittal143/Angular-First-Project.git
* git push -u origin master
@akshaymittal143
akshaymittal143 / booksjson.js
Created September 22, 2017 00:22
To import Book data into your mongoDB database. Make sure MongoDB is running then run 'mongo bookAPI < booksJson.js' from the command line.
db.books.insert([
{
title: 'War and Peace',
genre: 'Historical Fiction',
author: 'Lev Nikolayevich Tolstoy',
read: false
},
{
title: 'Les Misérables',
genre: 'Historical Fiction',