Skip to content

Instantly share code, notes, and snippets.

View chattes's full-sized avatar
🏠
Working from home

Sourav Chatterjee chattes

🏠
Working from home
  • Casting Networks
  • Toronto
  • 18:05 (UTC -12:00)
View GitHub Profile
@chattes
chattes / gradeCharts.js
Created February 4, 2021 15:40
Generate Grade Charts
const Students = [
{
name: "Zhao",
gender: 'M',
},
{
name: "John",
gender: 'M',
},
@chattes
chattes / chaining
Last active February 2, 2021 02:54
// Array.prototype = {
// left: num => x.slice(num),
// divideBy: x => x.map(y => y / num),
// value: x => x
// }
let t1 = [
{name: 'Alice', age: 20},
@chattes
chattes / Regex.md
Last active December 21, 2020 00:38
Regex

Match URL Pattern

/^https?:\/\/(?<domain>.*?)\/(?<tenant>.*?)\/(?<study>.*?)\/(?<rest>.*)$/gm

http://xxxx-dev.xxxxxxxx.edu/nuvalence/demo/test/hello/howare/you
@chattes
chattes / index.html
Created April 9, 2020 15:45
JS Bin Check constraints // source https://jsbin.com/fodajop
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Check constraints">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://gist.github.com/dlants/8d7fadfb691b511f1376ba437a9aaea9.js"></script>
Resize by X
-----------
:10winc + - < >
Open Terminal
-------------
:vsplit term://zsh
:split term://zsh
@chattes
chattes / gist:a08d685a372e0debef3bd860ee447adf
Created August 9, 2016 12:39
setTImeOut to Query TMDB api and avoid Too many request error
moviedb.discoverMovie(query_en, function (err, list) {
//Get Movie List page 1
if (err) {return console.log(err);}
movieDbList = movieDbList.concat(list.results);
//Query Limitation has been set by TMDB API- 40 Queries ---10 Second Wait Time--->Next Query
//Create an array of Queries by Page for the rest of the movies
//Create batches of 30 Request to be processed
for (var page_no = 2; page_no <= list.total_pages; page_no++) {
query_temp = query_en + '&page=' + page_no;
querybatch.push(query_temp);
//Controlling Visibility
var Animal = function Animal(init){
var privateInit = init;
var interface = {
getName: function(){
return "init Name: "+privateInit;
},
setName: function(newName){
privateInit = newName;