Skip to content

Instantly share code, notes, and snippets.

View codotronix's full-sized avatar
:octocat:
Life runs on Code

Suman Barick codotronix

:octocat:
Life runs on Code
View GitHub Profile
@codotronix
codotronix / imdb_top_100.js
Last active January 2, 2022 17:37
scraping imdb top 100 list data
/**
* Script to Scrape and Create the list of JSON Objects
*/
let movies = []
$('.lister-list .lister-item').each(function(){
let movie = {
title: $(this).find('.lister-item-header a').text().trim(),
released: $(this).find('.lister-item-year').text().replace(/[()]/gi, '').trim(),
certificate: $(this).find('.certificate').text().trim(),
runtime_min: $(this).find('.runtime').text().replace('min','').trim(),
@codotronix
codotronix / node_nginx_ssl.md
Created August 8, 2020 18:34 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@codotronix
codotronix / Prototypal Inheritance Experiments
Created April 21, 2019 15:14
Prototypal Inheritance Experiments
function Animal() {
this.color = "Black";
this.speak = function() {
console.log("I can't speak...");
}
}
/* Now let's create an animal object */
var animal = new Animal();
@codotronix
codotronix / Set Animal as prototype of Cow - JS Prototypal Inheritance
Created April 12, 2019 18:45
Set Animal as prototype of Cow - JS Prototypal Inheritance
Cow.prototype = new Animal();
/* or we could also write
* Cow.prototype = animal;
* since we have already created an "animal" object
*/
@codotronix
codotronix / Creating COW Class - JS Prototypal Inheritance
Created April 12, 2019 18:44
Creating COW Class - JS Prototypal Inheritance
/* let's define the Cow Class */
function Cow() {
this.type = "Domestic";
this.speak = function() {
console.log("Moooo...");
}
}
@codotronix
codotronix / Creating Animal Class - JS Prototypal Inheritance
Created April 12, 2019 18:41
Creating Animal Class - JS Prototypal Inheritance
/* Let's define an Animal Class */
function Animal() {
this.color = "Black";
this.speak = function() {
console.log("I can't speak...");
}
}
/* Now let's create an animal object */
var animal = new Animal();
/* Let's define an Student Class */
function Student(name) {
/* "var" keyword inside a class makes a variable PRIVATE */
var name = name;
var roll = 0; /* Let's initialize the roll no. to 0 */
/* Let's define a public variable */
this.section = 'A'; /* This can be accessed directly, no getter/setter needed */
/* prefixing "this" makes a field public */