Skip to content

Instantly share code, notes, and snippets.

View nilooy's full-sized avatar
💪

Niloy nilooy

💪
View GitHub Profile
@davisford
davisford / Setup MongoDB on localhost as Replica Set
Last active May 14, 2024 06:37
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1
@6temes
6temes / mysql_downgrade.txt
Last active February 11, 2024 16:08
Downgrade MySQL version with brew
# Kill rails server and guard
bin/spring stop
brew services stop mysql
brew uninstall mysql
brew install mysql@5.5
brew link mysql@5.5 --force
brew services start mysql@5.5
rbenv uninstall 2.3.3
rbenv install 2.3.3
gem install bundle
@sgup
sgup / recommended-routine.md
Last active June 25, 2024 07:33
Recommended Routine - Reddit BodyweightFitness
@CaptainN
CaptainN / Meteor Hooks Kitchen Sink.jsx
Last active January 1, 2021 21:52
Meteor Hooks Kitchen Sink
import { useTracker } from 'meteor/react-meteor-data'
// Create a reusable subscribe hook
const usePageSubscription = (pageId) => useTracker(() => {
const subscription = Meteor.subscribe('page', pageId)
return !subscription.ready()
}, [pageId])
// Separate page hook
const usePage = (pageId) => useTracker(() => {
@swaminator
swaminator / Monorepo.md
Last active October 30, 2020 14:12
Monorepo with Amplify CLI

Step 1: Set up your monorepo project

To get started, fork the following project.

git clone git@github.com:swaminator/monorepo-amplify.git

This project contains the frontend code for an angular and react Todo app. The repository has the following structure:

> monorepo-amplify
@Linch1
Linch1 / tokenPriceApi.js
Last active June 23, 2024 12:49
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js