Skip to content

Instantly share code, notes, and snippets.

View ishan123456789's full-sized avatar
🏀

Ishan Mahajan ishan123456789

🏀
  • Earth
View GitHub Profile
@ishan123456789
ishan123456789 / notes.md
Created July 6, 2020 17:52
GCP domain deployment

First go to compute engine and create an instance When created go to ssh and install nginx => sudo apt-get update && sudo apt-get install nginx When done you can now access through the IP mentioned along your instance through http://35.xx.x.xx Then we need to change the IP to a static one Go to VPC Network and change ephimeral to the static IP option THen Go to network services: Create a A record with your IP 35.xx.x.xx Create a CNAME with www.domain-name.com and value in alias domain-name.com

Go to your domain provider in my case it was godaddy

@ishan123456789
ishan123456789 / ffmpeg_m3eu8.sh
Last active July 4, 2020 03:48
This script helps to download any m3eu8 file to the user's local system
#!/usr/bin/env bash
# This script downloads a m3eu8 file to your local system
# Make sure ffmpeg command works in your terminal directly
# ./ffmpeg_m3eu8.sh https://VALID_SITE.m3u8 RANDOME_NAME_FOR_YOUR_FILE
URL_TO_FETCH=$1
FILE_INITIAL=$2
# Checking if VALID ARGUMENTS PROVIDED
@ishan123456789
ishan123456789 / Providers.js
Created June 17, 2020 14:40
Fix for strapi to allow multiple providers
// /extensions/users-permissions
"use strict";
/**
* Module dependencies.
*/
// Public node modules.
const _ = require("lodash");
const request = require("request");
@ishan123456789
ishan123456789 / Notes.md
Last active May 16, 2020 16:39
Notes Videos

You're good player but stuck with bad team 4 type of people explained, Based on time/Money Want/need explained, cannot negotiate price for success. Why you want what you want(Time & money)? Listen and learn from people who can guide you Willing to make some change, doing same thing expecting different result Linear income trade time get money Duplication/Train someone More positivity into mind

@ishan123456789
ishan123456789 / Notes.md
Last active May 12, 2020 18:07
Business of 21st Century notes

Common in all the rich dad poor dad series Take responsibility for your finances—or get used to taking orders for the rest of your life. You’re either a master of money or a slave to it. Your choice.

The corporate myth is over. If you’ve spent years climbing the corporate ladder, have you ever stopped to notice the view? What view, you ask? The rear end of the person in front of you. That’s what you get to look forward to.

This is the best time. When times are bad is when the real entrepreneurs emerge. Entrepreneurs don’t really care if the market’s up or down. They’re creating better products and better processes. So when somebody says, “Oh, there’s less opportunity now,” it’s because they’re losers.

Q: What do the Microsoft and Disney empires have in common, besides the fact that they are both hugely successful billion-dollar businesses that have become household names? A: They were both launched during a recession.

@ishan123456789
ishan123456789 / fasterModifiedPinnologger.ts
Last active May 4, 2020 10:23
Wrapper for pino logger to allow multiple arguments to be fitted in. As per original implementation pino logger accepts one argument only to be logged so with these you can have two args successfully logged.
// This implementation uses any for options as the type definitions are not official so this will allow us to use hooks
import pino from "pino";
const hooks = {
logMethod(inputArgs: any, method: any): any {
if (inputArgs.length >= 2) {
const arg1 = inputArgs.shift();
const arg2 = inputArgs.shift();
return method.apply(this, [arg2, arg1, ...inputArgs]);
}
@ishan123456789
ishan123456789 / script.js
Created April 7, 2020 08:55
Combination of valid word from a dictionary
var dic = require('./dic.json');
const stringToUse = "restaurant";
const arr = combinations(stringToUse);
const result = arr.filter(str => str.length> 1 && !!dic[str]).join(' ')
console.log(result);
// dictionary available at https://raw.githubusercontent.com/matthewreagan/WebstersEnglishDictionary/master/dictionary_compact.json
// https://codereview.stackexchange.com/a/7025/121772
function combinations(str) {
@ishan123456789
ishan123456789 / BulkOpToDuplicate.md
Last active January 27, 2020 05:38
Mongodb BenchMarking
import { Promise } from "bluebird";
// import fs from "fs";
import { ParameterizedContext } from "koa";
import Router from "koa-router";
import { performance, PerformanceObserver } from "perf_hooks";
const perQuery = 100;
const MongoClient = Promise.promisifyAll(require("mongodb").MongoClient);

const url = process.env.MONGODB_URI || "mongodb://127.0.0.1/OrderStats";
@ishan123456789
ishan123456789 / redme.md
Created November 27, 2019 18:16
Ghost setup

Running ghost ghost run ghost start

@ishan123456789
ishan123456789 / redme.md
Created November 27, 2019 18:16
Ghost setup

Running ghost ghost run ghost start