Skip to content

Instantly share code, notes, and snippets.

@alexandr-kazakov
alexandr-kazakov / index.ts
Created April 22, 2024 10:33 — 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);
let array = [5, 5, 7, 2, 9, 1, 1, 1, 8, 8, 2, 4, -100, -2, 4, 3, 2, 8, 100, 9, 1];
function quickSort(array) {
if (array.length <= 1) return array;
let minIndex = 0;
let maxIndex = array.length - 1;
let middleArray = [];
let lessArray = [];
let array = [5, 5, 7, 2, 9, 1, 1, 1, -100, -2, 4, 3, 2, 8, 100, 9, 1];
function quickSort(array) {
if (array.length <= 1) return array;
let middleArray = [];
let lessArray = [];
let moreArray = [];
let middleIndex = Math.floor(array.length / 2);
@alexandr-kazakov
alexandr-kazakov / swiper-lazyload-image-fix.html
Created October 28, 2019 05:26
Swiper bottom space fix
<!-- begin Swiper slider-->
<div class="swiper-box swiper-container" id="discounts-carousel">
<div class="swiper-box__wrapper swiper-wrapper">
<div class="swiper-box__item swiper-slide">
<div class="swiper-box__item-content"><a class="swiper-box__link" href="#"><img class="swiper-box__image swiper-lazy" data-src="img/content/swiper/home-1.jpg" alt="Описание" title="" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="/><span class="swiper-box__prelaoder swiper-lazy-preloader swiper-lazy-preloader-white"></span></a>
</div>
</div>
<div class="swiper-box__item swiper-slide">
<div class="swiper-box__item-content"><a class="swiper-box__link" href="#"><img class="swiper-box__image swiper-lazy" data-src="img/content/swiper/home-2.jpg" alt="Описание" title="" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="/><span class="swiper-box__prelaoder swiper-lazy-preloader swiper-lazy-preloader-white"></span></a>
</div>
<!doctype html>
<html ⚡4email>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script>
<script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>
<style amp4email-boilerplate>
body {
'use strict';
var result = [];
for (var i = 0; i < 5; i++) {
result[i] = (function(i) {
return function() {
console.log(i);
};
})(i);
/**
* Возводит x в степень n (комментарий JSDoc)
*
* @param {number} x число, которое возводится в степень
* @param {number} n степень, должна быть целым числом больше 1
*
* @return {number} x в степени n
*/
function pow(x, n) {
var result = x;
/* -------------------------------------------------------------------------
begin Product slider
* ------------------------------------------------------------------------- */
.slider-wrapper {
max-width: 700px;
margin: 0 auto;
overflow: hidden;
position: relative;
}
<!-- begin Product slider
=========================================================================== -->
<div class="slider-wrapper">
<div id="product-slider" class="product-slider royalSlider rsDefault">
<a class="rsImg" data-rsw="1200" data-rsh="700" data-rsbigimg="http://via.placeholder.com/1200x700/00BFFF/FFFFFF?text=1-Popup" href="http://via.placeholder.com/700x500/00BFFF/FFFFFF?text=1-Big">Vincent van Gogh - Still Life: Vase with Twelve Sunflowers
<img width="96" height="72" class="rsTmb" src="http://via.placeholder.com/96x72/00BFFF/FFFFFF?text=1-Small"> </a>
<a class="rsImg" data-rsw="1200" data-rsh="700" data-rsbigimg="http://via.placeholder.com/700x700/00BFFF/FFFFFF?text=2-Popup" href="http://via.placeholder.com/700x500/00BFFF/FFFFFF?text=2-Big">Vincent van Gogh - The Starry Night
<img width="96" height="72" class="rsTmb" src="http://via.placeholder.com/96x72/00BFFF/FFFFFF?text=2-Small"> </a>
<a class="rsImg" data-rsw="1200" data-rsh="700" data-rsbigimg="htt
/* -------------------------------------------------------------------------
begin Product slider
* ------------------------------------------------------------------------- */
.slider-wrapper {
max-width: 700px;
margin: 0 auto;
overflow: hidden;
position: relative;
}