Skip to content

Instantly share code, notes, and snippets.

View mandadimuralidharreddy's full-sized avatar

Muralidhar Reddy mandadimuralidharreddy

  • Hyderabad
View GitHub Profile
@mandadimuralidharreddy
mandadimuralidharreddy / Component.jsx
Created January 8, 2021 12:52 — forked from krambertech/Component.jsx
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@mandadimuralidharreddy
mandadimuralidharreddy / mongo-ls.js
Created December 15, 2017 07:43 — forked from matteofigus/mongo-ls.js
A script to list all the collections and document count for a specific mongodb db
// Usage: mongo {Server without mongodb:// example 127.0.0.1:27017}/{DbName} [-u {Username}] [-p {Password}] < ./mongo-ls.js
var collections = db.getCollectionNames();
print('Collections inside the db:');
for(var i = 0; i < collections.length; i++){
var name = collections[i];
if(name.substr(0, 6) != 'system')
print(name + ' - ' + db[name].count() + ' records');
@mandadimuralidharreddy
mandadimuralidharreddy / countries.json
Created August 8, 2017 09:57 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@mandadimuralidharreddy
mandadimuralidharreddy / facebook_headless_login_using_google_chrome.js
Last active March 22, 2021 16:02
Facebook login using google chrome headless browser
//install dev vesrion of google chrome form https://www.chromium.org/getting-involved/dev-channel
//install chrome-remote-interface from npm npm install chrome-remote-interface
const CDP = require('chrome-remote-interface');
CDP((protocol) => {
const {Page, Runtime} = protocol;
// First, need to enable the domains we're going to use.
Promise.all([
Page.enable(),
# Plain Ol' Node
node --max-old-space-size=1024 app.js # increase to 1gb
node --max-old-space-size=2048 app.js # increase to 2gb
node --max-old-space-size=3072 app.js # increase to 3gb
node --max-old-space-size=4096 app.js # increase to 4gb
node --max-old-space-size=5120 app.js # increase to 5gb
node --max-old-space-size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb