Skip to content

Instantly share code, notes, and snippets.

View ShaunLWM's full-sized avatar
🎯
Focusing

Shaun ShaunLWM

🎯
Focusing
View GitHub Profile
@ShaunLWM
ShaunLWM / Exploit.sol
Created May 1, 2022 12:24 — forked from arbazkiraak/Exploit.sol
Fei fETH-146 Fuse Pool exploit - Reentrancy on doTransferOut() while borrowing.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "hardhat/console.sol";
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
@ShaunLWM
ShaunLWM / tokenPriceApi.js
Created June 24, 2021 02:10 — 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":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"interna
@ShaunLWM
ShaunLWM / MEMOIZE.md
Created May 15, 2021 04:49 — forked from mrousavy/MEMOIZE.md
Memoize!!! πŸ’Ύ - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and Β 
returning the cached result when the same
inputs occur again. Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β 
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  β€” wikipedia
@ShaunLWM
ShaunLWM / wget.sh
Created August 12, 2020 02:49 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
TypeScript 33 hrs 33 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹β–‘β–‘ 89.3%
JSON 1 hr 39 mins β–‰β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 4.4%
Other 1 hr β–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.7%
JavaScript 18 mins ▏░░░░░░░░░░░░░░░░░░░░ 0.8%
CSS 15 mins ▏░░░░░░░░░░░░░░░░░░░░ 0.7%

Keybase proof

I hereby claim:

  • I am shaunlwm on github.
  • I am shaunlwm (https://keybase.io/shaunlwm) on keybase.
  • I have a public key ASBUhBOxwT0eVqCNYWqqLCI5qh85akDEPGfGPUm7kzJGQQo

To claim this, I am signing this object:

@ShaunLWM
ShaunLWM / stream_to_youtube.sh
Created May 22, 2019 01:44 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une rΓ©solution 720p. La vidΓ©o n'est pas scalΓ©e.
VBR="2500k" # Bitrate de la vidΓ©o en sortie
FPS="30" # FPS de la vidΓ©o en sortie
QUAL="medium" # Preset de qualitΓ© FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
const request = require('request');
const async = require('async');
const fs = require('fs');
const download = require('download');
let page = 0;
async.whilst(
function () { return page < 5440; },
// function () { return page < 20; },
function (callback) {
@ShaunLWM
ShaunLWM / JobManager.js
Created December 29, 2018 05:23
pcgamesdownload scraper
const Queue = require('bull');
const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
const Arena = require('bull-arena');
const express = require('express');
const app = express();
let arena = Arena({
queues: [{