Skip to content

Instantly share code, notes, and snippets.

View matheusfillipe's full-sized avatar

Matheus Fillipe matheusfillipe

  • https://gitlab.com/matheusfillipeag
  • Germany
View GitHub Profile
{
"initializationOptions": {
"markupKindPreferred": null,
"jediSettings": {
"autoImportModules": []
},
"completion": {
"disableSnippets": false
},
"diagnostics": {
#!/bin/bash
coin=0x15Ea6B8481bF1C991aC3dC8e67279d31651a56FE
curl --silent "https://r.poocoin.app/smartchain/assets/${coin}/info.json" | jq
curl --silent 'https://poocoin.app/api2/token-info-bsc' -X POST --data-raw '["'${coin}'"]' | jq
lpAddress=$(curl --silent 'https://poocoin.app/api2/token-info-bsc' -X POST --data-raw '["'${coin}'"]' | jq -r ".[0].lpAddress")
curl --silent 'https://api1.poocoin.app/top-holders?address='"$lpAddress" | jq
@matheusfillipe
matheusfillipe / index.js
Last active April 1, 2022 05:31
Get token price from pancake swap
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
@matheusfillipe
matheusfillipe / paste_this_in_js_console.js
Created April 19, 2022 23:59 — forked from Zibri/paste_this_in_js_console.js
Minimal javascript IRC client in console
function irc(nickname, server, chan, onmsg, onjoin) {
nickname = nickname || "nick_" + new Date().getTime().toString(36) + new Date().getMilliseconds().toString(36)
chan = chan || "Z" + new Date().getTime().toString(18) + Math.random().toString(36).substring(2)
server = server || "irc.unrealircd.org"
var init = 0
var ws = new WebSocket("wss://" + server);
var s = (c,l)=>setTimeout(console.log.bind(this, "%c%s", "font-size: 14px; color:" + c, new Date().toLocaleString("it") + ": " + l))
ws.onmessage = m=>{
if (m.data.indexOf("PING") == 0)
ws.send(m.data.replace("PI", "PO"));
@matheusfillipe
matheusfillipe / fixkeymaps.py
Last active April 23, 2022 04:02
Remove duplicated shortcuts on blender keymaps
# Reads all .py files in the current directory and checks if they have the global keyconfig_data
# caracteristic of blender keymaps and loops over the items of the keymaps removing duplicates.
# In the end saves them to the output directory
from pathlib import Path
from pprint import pformat
output = "output/"
boilerplate = """\
keyconfig_version = (3, 2, 4)
@matheusfillipe
matheusfillipe / proofOfWork.js
Last active April 26, 2022 23:49
Simple proof of work concept using javascript
// Proof or work
const difficulty = 3
async function sha256(message) {
const msgBuffer = new TextEncoder().encode(message);
const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
return hashHex;
}
@matheusfillipe
matheusfillipe / portfoward.go
Last active May 3, 2022 05:31
Go port fowarding
package main
import (
"os"
"bufio"
"fmt"
"log"
"net"
)
@matheusfillipe
matheusfillipe / main.dart
Last active June 8, 2022 21:20
Irc client in dart with null safety
import 'dart:convert';
import "package:irc/client.dart";
import "dart:io";
// This stores our configuration for this client
var config = Configuration(
host: "irc.dot.org.es",
port: 6697,
ssl: true,
@matheusfillipe
matheusfillipe / autorertart.sh
Last active July 9, 2022 06:25
Auto restart process on high cpu or if check command is failing
#!/usr/bin/env bash
# YPTSOCKET
TOP=20
YPTSOCKET=/var/www/html/AVideo/plugin/YPTSocket/server.php
MAXCPU=80.0
CPUSERVICE=ytsocket.service
# APACHE