Skip to content

Instantly share code, notes, and snippets.

@Linch1
Linch1 / tokenPriceApi.js
Last active May 22, 2025 04:15
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
@msurguy
msurguy / resetpass.php
Created March 27, 2013 01:24
Reset user's password in Laravel 3 through artisan command . Put this file into application/tasks Usage from command line : php artisan resetpass 1 nEwP@SSwOrd Where 1 is user's id and "nEwP@SSwOrd" is the new password
<?php
class Resetpass_Task {
public function run($arguments)
{
$userid = $arguments[0];
$newpass = $arguments[1];
$user = User::find($arguments[0]);
if($user){
@andreiz
andreiz / classifier.php
Last active August 27, 2024 09:42
A simple example of logistic regression via gradient descent in PHP.
<?php
error_reporting(E_ALL);
define('NUM_FEATURES', 3);
// My dataset describes cities around the world where I might consider living.
// Each sample (city) consists of 3 features:
// * Feature 1: average low winter temperature in the city
// * Feature 2: city population, in millions