Skip to content

Instantly share code, notes, and snippets.

View imakshath's full-sized avatar
🎯
Focusing

Akshath Kumar imakshath

🎯
Focusing
View GitHub Profile
@josephrussell-cn
josephrussell-cn / ampIframeTcfapiProxy.js
Last active February 28, 2022 19:49
Provides tcfapi interface to iframe window using amp-consent data
// amp-iframe tcfapi proxy
// The cne video player inside the iframe on amp does not have access to consent data.
// This script is creating a __tcfapi proxy that scripts needing it can call to obtain TCData.
// TCData is sourced from a postMessage with type=send-consent-data to sentinel=amp
// Should only execute on AMP pages where gdpr is enabled
var consentMetadata;
var consentString;
var gdprApplies;
var queue = [];

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@masahirompp
masahirompp / User.ts
Last active May 5, 2021 20:04
mongoose + typescript
/// <reference path="../tsd/tsd.d.ts" />
import mongoose = require('mongoose');
import passport = require('passport');
interface IUser extends mongoose.Document {
provider: string;
id: string;
authorId: string;
displayName: string;