Skip to content

Instantly share code, notes, and snippets.

View poonasor's full-sized avatar

Ricky Poon poonasor

View GitHub Profile
@MCKLtech
MCKLtech / create-order-square-php-sdk.php
Last active June 19, 2023 03:06
This gist gives a high level overview of how to create an order in Square using the PHP SDK. For an order to show in the Dashboard you must create, fulfill AND pay for the order.
$body = new \Square\Models\CreateOrderRequest;
//Add 5 of the same line items
//We are creating them dynamically
$qty = 5;
$lineItem = new \Square\Models\OrderLineItem($qty);
$lineItem->setName('Latte');
$money = new \Square\Models\Money;
$money->setCurrency('CAD');
//Amount in Cents e.g. $5.50
@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
@poonasor
poonasor / README.txt
Created July 13, 2021 15:11
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.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@bradtraversy
bradtraversy / laravel_xampp_setup.md
Created April 22, 2022 01:16
Laravel Xampp setup on Mac and Windows

Laravel Xampp Setup (Windows & Mac)

Install Xampp

Install Xampp from https://www.apachefriends.org/index.html

  • Run the Xampp installer and open the Xampp control panel
  • Make sure that you enable the Apache and MySQL services
  • On mac you need to click "Start" on the Home tab, "Enable" on the Network tab and "Mount" on the Location Tab. Click "Explore" on the location tab to open your Xampp/Lampp folder

Install Composer