Skip to content

Instantly share code, notes, and snippets.

View yarscript's full-sized avatar
:shipit:
I may be slow to respond.

YAro Script yarscript

:shipit:
I may be slow to respond.
View GitHub Profile
@yarscript
yarscript / tokenPriceApi.js
Created January 5, 2024 20:50 — forked from Linch1/tokenPriceApi.js
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
@yarscript
yarscript / .prettierrc.json
Created October 21, 2023 23:09
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
@yarscript
yarscript / getConfirmations.js
Created July 20, 2023 16:38 — forked from dsemenovsky/getConfirmations.js
Get Ethereum transaction confirmations count
async function getConfirmations(txHash) {
try {
// Instantiate web3 with HttpProvider
const web3 = new Web3('https://rinkeby.infura.io/')
// Get transaction details
const trx = await web3.eth.getTransaction(txHash)
// Get current block number
const currentBlock = await web3.eth.getBlockNumber()
ContractAddress TokenName TokenSymbol holder count transfer count # of times appears in list notes
0x420b595d8b648971b3bfcf46e66544c384860536 VenmoCash VMO 1 6 2
0xdeeb40536e94be7226b77fb89d7d3cd65a82fb85 Zoom Protocol ZOM 1 9 2
0xe670848d54788997942ecf938cd23b09550bae73 TARO TARO 1 4 2
0xf28fec34928a1dc19b650104ae082665b66f720e ETH/BTC Long-Only Alpha XTF.SWCEBL 1 4 2
0x030385efc63ebda6021d9098b1fcc422547d83d3 Tacos @ Taconomics.io $TACO 2 5 2
0x03bb9bbf0423e44370e88ec5fc31eecf4e2b4ac2 STVKE.Network STV 2 9 2
0x05e850909664a3cf926ca4777c3ec1577d36ec18 OnFlow Flow 2 8 2
0x06ca771a689d6d5f5e435be2ef1d1ffc6bdb3b4c Wing Token WING 2 8 2
0x08a958bdc9e0beb0c3ee2ec6e9c0013f14ce66e5 Harold Returns KEKW 2 6 2
@yarscript
yarscript / tip.md
Created June 2, 2023 10:58 — forked from devdrops/tip.md
Restart PHP-FPM on Mac

Restart PHP-FPM on Mac

as found on StackOverflow

And this command to restart my php-fpm:

brew services restart php56
@yarscript
yarscript / hero.ts
Created June 1, 2023 15:43 — forked from brennanMKE/hero.ts
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
@yarscript
yarscript / sequelize-cheatsheet.md
Created May 25, 2023 12:58 — forked from bgoonz/sequelize-cheatsheet.md
sequelize-cheat-sheetmd

Sequelize Cheatsheet

Command Line

Sequelize provides utilities for generating migrations, models, and seed files. They are exposed through the sequelize-cli command.

Init Project

$ npx sequelize-cli init

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@yarscript
yarscript / shake.css
Created May 10, 2023 07:04 — forked from nikitos-one/shake.css
“Shake” CSS Keyframe Animation
.shake:hover {
animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
transform: translate3d(0, 0, 0);
backface-visibility: hidden;
perspective: 1000px;
}
@keyframes shake {
10%, 90% {
transform: translate3d(-1px, 0, 0);
intitle:index.of .bash_history
intitle:index.of .sh_history
intitle:”Index of” index.html.bak
intitle:”Index of” index.php.bak
intitle:”Index of” index.jsp.bak
intitle:”Index of” “.htpasswd” htpasswd.bak
inurl:backup intitle:index.of inurl:admin
“Index of /backup”
intitle:”Index of” index.html~