Skip to content

Instantly share code, notes, and snippets.

View Jonsey's full-sized avatar

Damian Jones Jonsey

View GitHub Profile
@Jonsey
Jonsey / landing-page-prompt.md
Created December 19, 2024 10:33
Landing Page Prompt

Landingpage Generator

  1. Ask for the following in one batch: a) the main "Which topic do you like to cover": . b) Ask for the product (if no skip) "Do you have a specific product you can solve the pain of your client": c) Ask for more and d) Ask if the output should be German or English.

  2. Research online for the topic. If you able to research online then skip.

@Jonsey
Jonsey / GetVaultFeesWithDIsabledToken.sol
Created July 2, 2024 11:49
GetVaultFees With DIsabled Token Reverts with ErrorLibrary.TokenNotEnabled()
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;
import { IPortfolio } from "../../contracts/core/interfaces/IPortfolio.sol";
import { IPortfolioFactory } from "../../contracts/front-end-helpers/IPortfolioFactory.sol";
import { IAllowanceTransfer } from "../../contracts/core/interfaces/IAllowanceTransfer.sol";
import { IRebalancing } from "../../contracts/rebalance/IRebalancing.sol";
import { Addresses } from "../foundry/utils/Addresses.sol";
import { PortfolioDeployment } from "./utils/PortfolioDeployment.s.sol";
import { FunctionParameters } from "../../contracts/FunctionParameters.sol";
@Jonsey
Jonsey / SlippagePOC.t.sol
Created June 30, 2024 17:20
POC Proving slippage is checked before fees are applied
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;
import { IPortfolio } from "../../contracts/core/interfaces/IPortfolio.sol";
import { IPortfolioFactory } from "../../contracts/front-end-helpers/IPortfolioFactory.sol";
import { IAllowanceTransfer } from "../../contracts/core/interfaces/IAllowanceTransfer.sol";
import { IRebalancing } from "../../contracts/rebalance/IRebalancing.sol";
import { Addresses } from "../foundry/utils/Addresses.sol";
import { PortfolioDeployment } from "./utils/PortfolioDeployment.s.sol";
import { FunctionParameters } from "../../contracts/FunctionParameters.sol";
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
import "forge-std/console.sol";
import "forge-std/Test.sol";
contract XTest is DSTest {
uint256 expires = 1000;
uint256 constant GRACE_PERIOD = 90 days;
@Jonsey
Jonsey / lazy-loading.js
Created January 18, 2019 10:55
Using the intersection observer with Elm
function onEntry(entry) {
entry.forEach((change) => {
if(change.isIntersecting) {
change.target.classList.add('visible');
}
});
@Jonsey
Jonsey / TradeHistory.elm
Created December 13, 2017 21:01
HMAC Request
module Exchange.TradeHistory exposing (..)
import Crypto.HMAC exposing (sha256, sha512)
import Word.Bytes as Bytes
import Word.Hex as Hex
import Http
import HttpBuilder exposing (RequestBuilder, withBody, withHeader, withExpect, withQueryParams)
import Json.Decode exposing (..)
@Jonsey
Jonsey / gist:884081
Created March 23, 2011 21:41
Command events
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BrewPal.Modules.InventoryModule.ViewModels"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
mc:Ignorable="d"
x:Class="BrewPal.Modules.InventoryModule.MainMenuView"
d:DesignWidth="640" d:DesignHeight="480" Height="80" Padding="0,10"
@Jonsey
Jonsey / gist:880369
Created March 21, 2011 22:29
View Service
public class UIViewService : IUIViewService
{
readonly IRegionManager _regionManager;
public UIViewService(IRegionManager regionManager)
{
_regionManager = regionManager;
}
public void ActivateNewOrExistingViewInContentItem(UIElement view, string viewName, string regionName)
@Jonsey
Jonsey / gist:880363
Created March 21, 2011 22:26
Module initialisation
public class InventoryModule : IModule
{
protected IUnityContainer container;
protected IRegionManager regionManager;
protected InventoryModule(IUnityContainer container, IRegionManager manager)
{
this.container = container;
regionManager = manager;
class Bootstrapper : UnityBootstrapper
{
#region Overrides of UnityBootstrapper
protected override DependencyObject CreateShell()
{
var shell = new Shell();
shell.Show();
return shell;
}