Skip to content

Instantly share code, notes, and snippets.

@isaurssaurav
isaurssaurav / web_scrap.py
Last active April 3, 2020 11:15
web_scrap
# pip install requests
# pip install beautifulsoup4
import requests
from bs4 import BeautifulSoup
def get_HTML_text(url):
response = requests.get(url)
## if any websites throw 403 add user agent and cookie
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");
});

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 .
@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 $USER@192.168.0.20

Events

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

// Vanilla
document.addEventListener('DOMContentLoaded', function() {
@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
})
@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 / Ember : link-addon-to-other-project
Created July 18, 2017 08:49
link addon to other project in ember js
@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
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