Skip to content

Instantly share code, notes, and snippets.

View heeropunjabi's full-sized avatar
💻
Create Awesome Things

Heero heeropunjabi

💻
Create Awesome Things
View GitHub Profile
let Web3 = require("web3");
// Replace value of rpc with https://rpc-mumbai.matic.today for Mumbai
let rpc = "https://rpc-mainnet.matic.network";
const provider = new Web3.providers.HttpProvider(rpc);
const web3 = new Web3(provider);
// Add your private key
web3.eth.accounts.wallet.add("pvt-key");
@AlexanderKaluzhny
AlexanderKaluzhny / craco.config.js
Created August 4, 2019 16:34
Full content of my craco.config.js file
const path = require('path');
const fs = require('fs');
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
const appDevBuild = resolveApp('devBuild');
const WriteFilePlugin = require('write-file-webpack-plugin');

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

Enable macOS Server Performance Mode

Performance mode changes the system parameters of your Mac. These changes take better advantage of your hardware for demanding server applications.

A Mac with macOS Server that needs to run high-performance services can turn on performance mode to dedicate additional system resources for server applications. Note, however, that performance mode can be enabled even without macOS Server being installed to achieve similar benifits for other high-performance services.

sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2>/dev/null | cut -f 2-)"
sudo reboot

Reference: https://support.apple.com/en-us/HT202528.

@mordr
mordr / note.md
Last active March 18, 2024 20:58
Set Visual Studio Code as default editor for kubectl

Set KUBE_EDITOR to Visual Studio Code, assumes 'code' is in PATH

export KUBE_EDITOR='code --wait'

Running k edit ... will open up the yaml using Visual Studio Code.