Skip to content

Instantly share code, notes, and snippets.

View acagastya's full-sized avatar

Agastya Chandrakant acagastya

View GitHub Profile
const { URL } = require('url');
import fetch from 'node-fetch';
export const shouldTransform = url => {
const { host, pathname } = new URL(url);
return (
[
'instagram.com',
'www.instagram.com',
'instagr.am',

Class XI

  1. Sets
  2. Relations and Functions
  3. Trigonometric Functions
  4. Principles of Mathematical Inductions
  5. Complex Numbers and Quadratic Equations
  6. Linear Inequalities
  7. Permutations and Combinations
  8. Binomial Theorem
  9. Sequence and Series
const math = require('mathjs');
const LOOPS = 2.5 * 10 ** 7;
const xLim = 1;
const yLim = 1;
const r = Math.random;
let res = 0;
for (let i = 0; i < LOOPS; i++) {
const p1 = { x: r(), y: r() };
const p2 = { x: r(), y: r() };
class Point {
constructor(x = 0, y = 0) {
this.x = x;
this.y = y;
}
set coords({ x = 0, y = 0 }) {
if (!Number.isNaN(x)) this.x = x;
if (!Number.isNaN(y)) this.y = y;
}
get coords() {
const math = require('mathjs');
const LOOPS = 2.5 * 10 ** 7;
const xLim = 1;
const yLim = 1;
const r = Math.random;
let res = 0;
for (let i = 0; i < LOOPS; i++) {
const p1 = { x: r(), y: r() };
const p2 = { x: r(), y: r() };
(function intersect() {
const LOOPS = 2.5 * 10 ** 8;
let count = 0;
const { random: r, sqrt: s } = Math;
for (let i = 0; i < LOOPS; i++) {
let x = r();
let y = r();
const a = { x, y };
x = r();
y = r();
@acagastya
acagastya / arr.js
Last active March 12, 2020 10:11
array of OSM entries with names
[
{
name: "Bangalore Junction",
url: "https://www.openstreetmap.org/way/373566738"
},
{
name: "Phoenix Marketcity",
url: "https://www.openstreetmap.org/way/169256025"
},
{