Skip to content

Instantly share code, notes, and snippets.

@zhe-t
zhe-t / sendTxWithJito.ts
Last active May 1, 2024 16:20
Smart send a transaction using Jito dedicated endpoint
import { Connection, SendOptions } from '@solana/web3.js';
export type JitoRegion = 'mainnet' | 'amsterdam' | 'frankfurt' | 'ny' | 'tokyo';
export const JitoEndpoints = {
mainnet: 'https://mainnet.block-engine.jito.wtf/api/v1/transactions',
amsterdam: 'https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions',
frankfurt: 'https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions',
ny: 'https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions',
tokyo: 'https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions',
};
export function getJitoEndpoint(region: JitoRegion) {
@davydany
davydany / IPTABLES-CHEATSHEET.md
Last active May 1, 2024 16:17
IP Tables (iptables) Cheat Sheet

IP Tables (iptables) Cheat Sheet

IPTables is the Firewall service that is available in a lot of different Linux Distributions. While modifiying it might seem daunting at first, this Cheat Sheet should be able to show you just how easy it is to use and how quickly you can be on your way mucking around with your firewall.

Resources

The following list is a great set of documentation for iptables. I used them to compile this documentation.

struct SoundMakerIntent: AudioPlaybackIntent {
static var title: LocalizedStringResource = "Play a sound"
static var description: IntentDescription = IntentDescription("Plays a widget sound")
@Parameter(title: "Sound")
var sound: WidgetSound
init() {}
init(sound: WidgetSound) {
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@mariovalney
mariovalney / pre-commit
Last active May 1, 2024 16:12
Pre-commit hook to check code with PHPCS, fix with PHPCBF and check mess with PHPMD
#!/bin/sh
#########################
# #
# Initializing #
# #
#########################
##
# You should add all tools as composer dependencies or change this path
@scrapix
scrapix / DSM7.2-USB-DRIVER.md
Last active May 1, 2024 16:12
Synology DSM 7.2 - Adding USB Devices / Dongles (SkyConnect / Z-Wave)

Adding SkyConnect Dongle according to Blog Post or better Youtube

image

Summary

Synology has disabled USB drivers. Additionally one important driver is not available on Synology DSM 7+. Thus we need to enable some USB drivers plus download one driver and enable this on the system. For future DSM updates we need to add a Scheduled Task, so that the drivers will be loaded.

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@ihollander
ihollander / VSCode-live-server-setup.md
Last active May 1, 2024 16:11
Setup instructions for Live Server in VSCode (how to prevent issues working with json-server)

Problem Statement

Live Server is a great tool for working with Javscript. It automatically reloads our code any time changes are made to files in the folder where Live Server is running. This becomes an issue when using a tool like json-server with a .json file in the same directory - since changes you make using POST/PATCH/DELETE requests will update the .json file, these changes will also cause your app to reload.

Solution

You can solve this by telling Live Server to ignore changes to certain files. Open your VSCode preferences by pressing command + shift + p in VSCode and searching for "Preferences: Open Settings (JSON)". Then, add the following lines to the settings.json file:

"liveServer.settings.ignoreFiles": [
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 1, 2024 16:10
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@bahadiraraz
bahadiraraz / Git_Commit_Freeze_Solution.md
Last active May 1, 2024 16:09
Git Commit Freeze Due to GPG Lock Issues (Solution)

Git Commit Freeze Due to GPG Lock Issues

If you encounter a problem where you cannot commit changes in Git – neither through the terminal nor via the GitHub Desktop application – the issue might be a freeze during the Git commit process. This is often caused by GPG lock issues. Below is a concise and step-by-step guide to resolve this problem.

Solution Steps

1. Check for GPG Lock Messages

Open your terminal and try to perform a GPG operation (like signing a test message). If you see repeated messages like gpg: waiting for lock (held by [process_id]) ..., it indicates a lock issue.