Skip to content

Instantly share code, notes, and snippets.

@isaurssaurav
isaurssaurav / angular2.queryParams.ts
Created March 25, 2017 15:15
working with query param in angular 2
//pass a query param
onNavigate(){
this.router.navigate(['/'],{queryParams:{"analytics":100}});
}
//get a query param in that component, here it is / so it refers to main or home compnent
import { Component, OnInit,OnDestroy } from '@angular/core';
import {Router} from '@angular/router';
import {Subscription} from 'rxjs/Rx';
git add '*.txt'
git log: gives a committed with author and date
git remote add origin https://github.com/try-git/try_git.git
git push -u origin master
git
@isaurssaurav
isaurssaurav / fatal-error-watch.txt
Created June 15, 2017 04:58
grunt watch error waiting fatal error watch enospc
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@isaurssaurav
isaurssaurav / Ember : link-addon-to-other-project
Created July 18, 2017 08:49
link addon to other project in ember js
@isaurssaurav
isaurssaurav / godaddy domain point to s3bucket
Last active August 20, 2019 06:45
Point Godaddy domain to aws s3 bucket
In AWS Console
1. Create a bucket
1.1 name a bucket as domain for easy purpose
2. Go to properties of bucket
2.1. Go to edit bucket policy
- in text editor, edit a resource key with your domain name after ::
2.2. Go to static web hosting
- Enable a webhosting option
2.2.1. There is a endpoint link which is used to point your bucket to domain
@isaurssaurav
isaurssaurav / README.md
Created November 15, 2017 08:56 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})

Events

// jQuery
$(document).ready(function() {
  // code
})

// Vanilla
document.addEventListener('DOMContentLoaded', function() {
@isaurssaurav
isaurssaurav / minikubeportforwarding
Last active January 18, 2023 18:04
Port forwarding of VM (minikube) to host machine
The ssh way
Assuming that you have ssh on your ubuntu box.
Minikube user: docker password: tcuser
First run kubectl proxy & to expose the dashboard on http://localhost:8001
Then expose the dashboard using ssh's port forwarding, executing:
ssh -R 30000:127.0.0.1:8001 [email protected]

JS Questions:

  • Explain event in JS and event delegation
  • Explain how this works in JavaScript
  • Explain how prototypal inheritance works
  • Explain IFE
  • What's the difference between a variable that is: null, undefined or undeclared?
  • What is a closure, and how/why would you use one?
  • What's the difference between .call and .apply?
  • Explain Ajax .
var app = require("express")();
var http = require("http").Server(app);
var io = require("socket.io")(http);
var Usercounter = 0;
app.get("/", function(req, res) {
res.sendFile(__dirname + "/index.html");
});