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
// 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"; | |
/** |
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 "@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; |
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
#' Calculate the real return on an index fund. | |
#' | |
#' @param yield - percent as a decimal | |
#' @param expense_ratio - percent as a decimal | |
#' @param balance | |
#' @param n - number of years | |
#' | |
#' @return | |
#' @examples | |
real_return_n <- function(yield, expense_ratio, starting_balance, n) { |
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
#' Calculate the real return on an index fund over a single year. | |
#' | |
#' @param yield - percent as a decimal | |
#' @param expense_ratio - percent as a decimal | |
#' @param balance | |
#' | |
#' @return | |
#' @examples | |
real_return <- function(yield, expense_ratio, balance) { | |
# if there was no expense ratio, this would be your new balance |
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
def is_visible(object_value, current_visibility, desired_visibility): | |
specified = object_value['visibility'] | |
if current_visibility == 'hide': | |
if desired_visibility == 'show': | |
return specified == desired_visibility | |
else: | |
return True | |
# current_visibility is "show"... |
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
.gradle/ | |
.idea/ | |
build/ | |
*.iml | |
gradle/ |
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
const restify = require('restify'); | |
const server = restify.createServer(); | |
const Bacon = require('baconjs'); | |
server.get('/', function(req, res, next) { | |
const a = Bacon.once('a'); | |
const b = Bacon.once('b'); |
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 scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.Future | |
case class Tag(name:String = "0") | |
object HelloWorld { | |
def fetchAllTags:Future[List[Tag]] = Future{ List(Tag("a"), Tag("b"), Tag("c")) } |
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
static private class TaskUnionRepeatQuery implements TaskQuery | |
{ | |
@Override | |
public Cursor query(SQLiteOpenHelper openHelper, | |
Uri url, | |
String[] projectionIn, | |
String selection, | |
String[] selectionArgs, | |
String sort) | |
{ |
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
package com.frankandrobot.reminderer.datastructures; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Calendar; | |
/** | |
* A datastructure with auto-generated getters and setters. | |
* | |
* It is possible to write functions that take variable __names__ as arguments |
NewerOlder