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 { 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); |
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
{ | |
"meta": { | |
"theme": "stackoverflow" | |
}, | |
"basics": { | |
"name": "Max Girkens", | |
"label": "Web Development", | |
"summary": "", | |
"website": "https://web-development.cc/", | |
"city": "Aachen", |
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
<?php | |
/** | |
* Class CachedMySQLDatabase | |
* @inheritdoc | |
*/ | |
class CachedMySQLDatabase extends MySQLDatabase | |
{ | |
protected $cache = array(); |
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
<?php | |
/** | |
* Class CachedMySQLDatabase | |
* @inheritdoc | |
*/ | |
class CachedMySQLDatabase extends MySQLDatabase | |
{ | |
protected $cache = array(); |
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
(function(){ | |
var v = "1.3.2"; | |
if (window.jQuery === undefined || window.jQuery.fn.jquery < v) { | |
var done = false; | |
var script = document.createElement("script"); | |
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js"; | |
script.onload = script.onreadystatechange = function(){ | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { |
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
header("Content-type: text/xml; charset=utf-8"); | |
//create your XML document, using the namespaces | |
$urlset = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" /><!--?xml version="1.0" encoding="UTF-8"?-->'); | |
//iterate over your sites pages or whatever you like | |
foreach (getMyPagesOrWhatEver() as $item): | |
//add the page URL to the XML urlset |
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
(function($) { | |
$.fn.magnetic = function(options) { | |
var obj = this.find(options.selector); | |
var initialLeft = parseInt(obj.css('left')); | |
var mainOffset = this.offset().left; | |
var fixAt = (initialLeft - options.left ) + mainOffset; | |
this.on('scroll', function() { |
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
<?php | |
public function duplicate() { | |
$items_to_duplicate = array( | |
'Images', | |
'Somehting' | |
); | |
$page = parent::duplicate(); |
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
# install silverstripe + common modules from github | |
# usage sh install_silverstripe.sh <folder_name> <tag/branch> | |
# examples: | |
# sh install_silverstripe.sh some_folder tags/2.4.5 | |
# sh install_silverstripe.sh some_folder master | |
#set up project base folder | |
git clone git@github.com:silverstripe/silverstripe-installer.git $1 | |
cd $1 | |
git checkout $2 |
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
jQuery.fn.scrollToViewPort = function(options) { | |
var animTimeInterval = (typeof options.interval == "undefined")?"slow":animTimeInterval; | |
return this.each(function(){ | |
var offSet = (typeof options.offset == "undefined")? $(this).offset().top : options.offset; | |
if( $(this).offset().top <= $(window).scrollTop() || ( $(this).offset().top + $(this).height() ) >= ( $(window).scrollTop() + $(window).height() ) ){ | |
$('html,body').animate( { scrollTop: offSet }, animTimeInterval ); | |
} | |
}); | |
} |