This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"version":"0.1.0","name":"pump","instructions":[{"name":"initialize","docs":["Creates the global state."],"accounts":[{"name":"global","isMut":true,"isSigner":false},{"name":"user","isMut":true,"isSigner":true},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[]},{"name":"setParams","docs":["Sets the global state parameters."],"accounts":[{"name":"global","isMut":true,"isSigner":false},{"name":"user","isMut":true,"isSigner":true},{"name":"systemProgram","isMut":false,"isSigner":false},{"name":"eventAuthority","isMut":false,"isSigner":false},{"name":"program","isMut":false,"isSigner":false}],"args":[{"name":"feeRecipient","type":"publicKey"},{"name":"initialVirtualTokenReserves","type":"u64"},{"name":"initialVirtualSolReserves","type":"u64"},{"name":"initialRealTokenReserves","type":"u64"},{"name":"tokenTotalSupply","type":"u64"},{"name":"feeBasisPoints","type":"u64"}]},{"name":"create","docs":["Creates a new coin and bonding curve."],"accounts":[{"name":"mint","isMut":true,"isSigner":true},{"n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# LATEST VERSION OF THIS SCRIPT: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4 | |
# FORKED FROM: https://gist.github.com/ddwang/0046da801bcb29d241869d37ad719394 | |
# 1) No longer has a hard-coded COMMIT | |
# 2) Auto-symlinks a "code" script to avoid wslCode.sh breaking | |
# HOW TO INSTALL: | |
# 1) Remove "c:\Users\<USER_NAME>\AppData\Local\Programs\cursor\resources\app\bin" from Windows Environment Settings | |
# 2) Modify this script with your Windows <USER_NAME> (NOT your WSL username) in the VSCODE_PATH variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Mass Unlikes All Your Likes on a given date | |
// 1. open your likes tab | |
// 2. input the dates for which you'd like to unlike tweets | |
// 3. drop this into browser console and hit Enter | |
(function() { | |
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | |
const targetDates = ['Aug 8', 'Aug 9', 'Aug 10', 'Aug 11']; // Add or remove dates as needed | |
function isElementInViewport(el) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1/ install ubuntu live server (skip docker here and manually post-install (during ubuntu install it will use snap socker and it's utter shit and will cause you headaches), openssh) | |
2/ set static ip (/etc/netplan/static.yaml): | |
network: | |
version: 2 | |
renderer: networkd | |
ethernets: | |
<your-interface>: | |
addresses: | |
<your-local-static-ip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def int_to_privkey(n): | |
hex_n = hex(n)[2:] # convert to hexadecimal and strip the "0x" prefix | |
return hex_n.rjust(64, '0') # pad with zeros to the left until it's 64 characters long | |
int_to_privkey(random.randing(0, 2 ** 256 - 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Two pointers: one input, opposite ends | |
```python3 | |
def fn(arr): | |
left = ans = 0 | |
right = len(arr) - 1 | |
while left < right: | |
# do some logic here with left and right | |
if CONDITION: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def number_to_base(n, b): | |
if n == 0: | |
return [0] | |
digits = [] | |
while n: | |
digits.append(int(n % b)) | |
n //= b | |
return digits[::-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict, Tuple | |
from brownie import accounts, chain | |
from dataclasses import dataclass | |
# ! 1. losing threshold to be set manually here | |
# ! 2. bids to be set manually here | |
# ! 3. set the account to rkl refunder account in main | |
# if the bid is below this value, it has lost the auction | |
# it is possible that there may be two bids for the same |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
def decorator(function): | |
"""A general decorator function""" | |
@functools.wraps(function) | |
def wrapper(*args, **kwargs): | |
# Write decorator function logic here | |
# Before function call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to read the logs that cron produced due to running something: cat /var/mail/$USER | |
to read the logs of when and if cron launched jobs: sudo cat /var/log/cron | |
to restart the cron service: sudo systemctl restart crond |
NewerOlder