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
// | |
// TextViewExperiment.swift | |
// Wilson Cusack | |
// | |
// Most of the code from https://www.icalvin.dev/post/403 | |
// There's a few changes, but mainly just the ability to close the keyboard. | |
// | |
import SwiftUI | |
import UIKit |
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
struct HorizontalList<Item, Card, Detail>: View where Item: NSManagedObject, Card: View, Detail: View{ | |
var items: FetchedResults<Item> | |
var card: (Item) -> Card | |
var detail: (Item) -> Detail | |
// init(items: FetchedResults<Item>, @ViewBuilder card: @escaping (Item) -> Card, @ViewBuilder detail: @escaping (Item) -> Detail) { | |
// self.items = items | |
// self.card = card | |
// self.detail = detail | |
// } |
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
pragma solidity ^0.6.0; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/math/SafeMath.sol"; | |
contract Commune is ERC20 { | |
using SafeMath for uint256; | |
constructor() public ERC20("Commune DAI", "COMD") { | |
} |
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 decimalString(uint256 number, uint8 decimals, bool isPercent) private pure returns(string memory){ | |
uint8 percentBufferOffset = isPercent ? 1 : 0; | |
uint256 tenPowDecimals = 10 ** decimals; | |
uint256 temp = number; | |
uint8 digits; | |
uint8 numSigfigs; | |
while (temp != 0) { | |
if (numSigfigs > 0) { | |
// count all digits preceding least significant figure |
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
type Loan @entity { | |
id: ID! | |
closed: Boolean! | |
perSecondInterestRate: BigInt! | |
accumulatedInterest: BigInt! | |
lastAccumulatedTimestamp: BigInt! | |
durationSeconds: BigInt! | |
loanAmount: BigInt! | |
collateralTokenId: BigInt! | |
collateralContractAddress: Bytes! |
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
pragma solidity 0.8.6; | |
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "../interfaces/INFTLoanFacilitator.sol"; | |
struct LendValues { | |
uint256 loanAmount; | |
uint256 perSecondInterestRate; |
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
interface Vm { | |
function prank(address) external; | |
} | |
contract Foo { | |
function bar() public { | |
require(msg.sender == address(1), 'wrong sender'); | |
} | |
function barPayable() public payable { |
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
{ | |
sales(where: {nftContractAddress: "0x8d04a8c79ceb0889bdd12acdf3fa9d207ed3ff63", nftTokenId: "606"} orderBy: timestamp, orderDirection: desc) | |
{ | |
id | |
nftTokenId | |
price | |
} | |
} |
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
use ethers::{ | |
signers::{LocalWallet, Signer}, | |
}; | |
fn main() { | |
let vanity_hex = "01"; | |
// OR pass as input | |
// let mut args: Args = args(); | |
// let vanity_hex = args.nth(1).unwrap(); | |
let bytes_to_match = hex::decode(vanity_hex).expect("invalid hex"); |
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
export type Maybe<T> = T | null; | |
export type InputMaybe<T> = Maybe<T>; | |
export type Loan_Filter = { | |
closed?: InputMaybe<Scalars['Boolean']>; | |
closed_in?: InputMaybe<Array<Scalars['Boolean']>>; | |
closed_not?: InputMaybe<Scalars['Boolean']>; | |
closed_not_in?: InputMaybe<Array<Scalars['Boolean']>>; | |
}; | |
OlderNewer