Skip to content

Instantly share code, notes, and snippets.

View 1997roylee's full-sized avatar
💭
Coding

0xRoy 1997roylee

💭
Coding
View GitHub Profile
{
"version": "0.1.0",
"name": "pump",
"instructions": [
{
"name": "initialize",
"docs": [
"Creates the global state."
],
"accounts": [
@1997roylee
1997roylee / index.ts
Created April 28, 2024 14:56 — forked from endrsmar/index.ts
Raydium new pool listener
import { LiquidityPoolKeysV4, MARKET_STATE_LAYOUT_V3, Market, TOKEN_PROGRAM_ID } from "@raydium-io/raydium-sdk";
import { Connection, Logs, ParsedInnerInstruction, ParsedInstruction, ParsedTransactionWithMeta, PartiallyDecodedInstruction, PublicKey } from "@solana/web3.js";
const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com';
const RAYDIUM_POOL_V4_PROGRAM_ID = '675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8';
const SERUM_OPENBOOK_PROGRAM_ID = 'srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX';
const SOL_MINT = 'So11111111111111111111111111111111111111112';
const SOL_DECIMALS = 9;
const connection = new Connection(RPC_ENDPOINT);
@1997roylee
1997roylee / deep-link-from-browser.js
Created March 20, 2023 18:03 — forked from diachedelic/deep-link-from-browser.js
Deep link to a native app from a browser, with a fallback
@1997roylee
1997roylee / xcode-clang-vers
Created August 17, 2022 08:53 — forked from yamaya/xcode-clang-vers
Xcode clang version record
# Xcode 4.3.3
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
# Xcode 4.3.2
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
# frozen_string_literal: true
module DeepFindHelper
def deep_find(hash, key)
return nil unless hash.is_a?(Hash)
hash.filter do |k, v|
if v.is_a?(Hash)
deep_find(v, key)
else
@1997roylee
1997roylee / tokens_helper.rb
Created October 3, 2021 19:46
tokens_helper.rb
module TokensHelper
extend ActiveSupport::Concern
module ClassMethods
def define_token_helpers(mapping)
class_eval <<-METHODS, __FILE__, __LINE__ + 1
def current_#{mapping}_token
@current_#{mapping}_token ||= #{mapping}_application.access_tokens.find_by(resource_owner_id: current_user.id)
@current_#{mapping}_token.token
end
@1997roylee
1997roylee / base_error.rb
Created September 30, 2021 21:03
BaseError
# frozen_string_literal: true
module Errors
module BaseError
extend ActiveSupport::Concern
included do
class_attribute :errors, instance_accessor: false
self.errors = Hash.new({ status: nil, code: nil, message: nil })
end
;(function () {
const ipadWidth = 519 - 44
const scrollHeight = Math.max(
document.body.scrollHeight,
document.documentElement.scrollHeight,
document.body.offsetHeight,
document.documentElement.offsetHeight,
document.body.clientHeight,
document.documentElement.clientHeight
)
*{
box-sizing: border-box;
font-family: 'Ubuntu', sans-serif;
}
img{
width: 100%;
}
h2{