Skip to content

Instantly share code, notes, and snippets.

View TheRealSmeddy's full-sized avatar
🎯
Focusing

Va TheRealSmeddy

🎯
Focusing
View GitHub Profile
@TheRealSmeddy
TheRealSmeddy / tsconfig.json
Created June 2, 2023 06:32
Typescript config starter
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
@TheRealSmeddy
TheRealSmeddy / .eslintrc.json
Created June 1, 2023 11:10
eslintrc with typescript and prettier
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
{
"semi": true,
"trailingComma": "es5",
"printWidth": 120,
"useTabs": true,
"tabWidth": 1
}
@TheRealSmeddy
TheRealSmeddy / jimpText.js
Created May 31, 2023 17:44
Generates JImp text with required font color.
function main() {
const imageWidth = 800;
const imageHeigh = 220;
const image = new Jimp(imageWidth, imageHeigh);
// Dont forget to hold bitmap png files also
const fontPath = "path/to/Font.ftn";
Jimp.loadFont(
fontPath
@TheRealSmeddy
TheRealSmeddy / sshAuthorizedKeysFix.sh
Created February 17, 2023 09:46
Fixes permissions issues.
chmod go-w $HOME $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys
chown `whoami` $HOME/.ssh/authorized_keys
@TheRealSmeddy
TheRealSmeddy / restartTouchpad.sh
Created February 6, 2023 05:04
Restart the touchpad, fixes mouse freeze
sudo modprobe -r psmouse
sudo modprobe psmouse
@TheRealSmeddy
TheRealSmeddy / getDecodedERC1155EventLogs.js
Created October 4, 2022 11:33
Returns array of decoded objects
async function getDecodedERC1155EventLogs(transactionHash) {
const singleTransferSigHash =
"0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62";
const batchTransferSigHash =
"0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb";
const txReceipt = await web3.eth.getTransactionReceipt(transactionHash);
const logs = txReceipt.logs.filter(
(log) =>
@TheRealSmeddy
TheRealSmeddy / getDecodedERC721EventLogs.js
Created October 4, 2022 11:18
Returns array of decoded objects
async function getDecodedERC721EventLogs(transactionHash) {
const txReceipt = await web3.eth.getTransactionReceipt(transactionHash);
const transferSigHash =
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef";
// Filtring by trasnfer event signature hash and data (can also filter by topics length)
const logs = txReceipt.logs.filter(
(log) => log.topics[0] === transferSigHash && log.data === "0x"
);
@TheRealSmeddy
TheRealSmeddy / keybinding.json
Created June 15, 2022 09:25
VSCode Vim Keybindings
[
{
"key": "ctrl+alt+v",
"command": "toggleVim"
},
{
"key": "shift+alt+j",
"command": "editor.action.moveLinesDownAction"
},
{
@TheRealSmeddy
TheRealSmeddy / settings.json
Last active November 30, 2022 15:22
VSCode Vim configurations
{
"files.autoSave": "afterDelay",
"vim.easymotion": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.sneak": true,
"vim.easymotionMarkerBackgroundColor": "#020202",
"vim.leader": "\\",