Skip to content

Instantly share code, notes, and snippets.

@frankandrobot
frankandrobot / Boid.ts
Created January 17, 2022 06:02
Flocking - An implementation of Daniel Shiffman's Boids program to simulate the flocking behavior of birds. Each boid steers itself based on rules of avoidance, alignment, and coherence. https://processing.org/examples/flocking.html
import "@pixi/math-extras";
import { Point } from "pixi.js";
/**
*
* Limit the magnitude of the point to the given max.
*/
function limit(p: Point, max: number): Point {
const x = p.x;
const y = p.y;
@frankandrobot
frankandrobot / flashLoan.sol
Created October 6, 2022 02:58
Nonworking flash loan contract
// SPDX-License-Identifier: mit
pragma solidity >=0.6.12;
import "@sushiswap/bentobox/contracts/interfaces/IBentoBoxV1.sol";
import "@sushiswap/bentobox/contracts/interfaces/IFlashBorrower.sol";
import "@boringcrypto/boring-solidity/contracts/libraries/BoringERC20.sol";
import "hardhat/console.sol";
import "../shared/Withdrawable.old.sol";
/**