Skip to content

Instantly share code, notes, and snippets.

View ivanmolto's full-sized avatar
💚
regen

Ivan Molto ivanmolto

💚
regen
View GitHub Profile
@ivanmolto
ivanmolto / freebieSwap.js
Created May 18, 2020 08:45 — forked from katelynsills/freebieSwap.js
Give a freebie to both participants while swapping
/* eslint-disable no-use-before-define */
import harden from '@agoric/harden';
import produceIssuer from '@agoric/ertp';
//import { makeZoeHelpers } from './contractSupport';
import { makeZoeHelpers, defaultAcceptanceMsg } from '@agoric/zoe/src/contractSupport';
// zcf is the Zoe Contract Facet, i.e. the contract-facing API of Zoe
export const makeContract = harden(zcf => {
const helpers = makeZoeHelpers(zcf);
const { assertKeywords, checkHook, swap } = helpers;

Development Environment Setup

This is Gabriel Cardona's AVA Labs-centric development environment setup. Use at your own risk. Your mileage may vary.

Terminal

iTerm2 is a replacement for Terminal

Shell

import {
Avalanche,
BinTools,
BN,
Buffer
} from "../../src";
import {
AVMAPI,
KeyChain,
UTXOSet,
import {
Avalanche,
BinTools,
BN,
Buffer
} from "../../src";
import {
AVMAPI,
KeyChain as AVMKeyChain,
SECPTransferOutput,
import {
Avalanche,
BinTools,
BN,
Buffer
} from "../../src";
import {
AVMAPI,
KeyChain as AVMKeyChain,
SECPTransferOutput,
@ivanmolto
ivanmolto / less.md
Created May 15, 2021 10:01 — forked from nnja/less.md
A cheatsheet for using less on the command line

Tips for using less on the command line.

To navigate:

  • f = for next page
  • b = for previous page

To search:

  • /<query>
@ivanmolto
ivanmolto / CTHelpers.sol
Created May 26, 2021 11:13 — forked from cag/CTHelpers.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
pragma solidity ^0.6.0;
import { IERC20 } from "github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
library CTHelpers {
/// @dev Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.
/// @param oracle The account assigned to report the result for the prepared condition.
/// @param questionId An identifier for the question to be answered by the oracle.
/// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
function getConditionId(address oracle, bytes32 questionId, uint outcomeSlotCount) internal pure returns (bytes32) {
@ivanmolto
ivanmolto / listings.ts
Created June 11, 2021 20:34 — forked from djirdehh/listings.ts
Mock listings data used in lesson 3.3 of the TinyHouse Masterclass - Part II
const listings: Listing[] = [
{
_id: new ObjectId("5d378db94e84753160e08b30"),
title: "Clean and fully furnished apartment. 5 min away from CN Tower",
description:
"2 bed, 2 bathroom cozy apartment in the heart of downtown Toronto and only 5 min away from the CN Tower, Scotiabank Arena, and Rogers Center.",
image:
"https://res.cloudinary.com/tiny-house/image/upload/v1560641352/mock/Toronto/toronto-listing-1_exv0tf.jpg",
host: "5d378db94e84753160e08b57",
type: ListingType.Apartment,
@ivanmolto
ivanmolto / users.ts
Created June 11, 2021 20:34 — forked from djirdehh/users.ts
Mock users data used in lesson 3.3 of the TinyHouse Masterclass - Part II
const users: User[] = [
{
_id: "5d378db94e84753160e08b55",
token: "token_************",
name: "James J.",
avatar:
"https://res.cloudinary.com/tiny-house/image/upload/w_1000,ar_1:1,c_fill,g_auto/v1560648533/mock/users/user-profile-1_mawp12.jpg",
contact: "james@tinyhouse.com",
walletId: "acct_************",
income: 723796,
@ivanmolto
ivanmolto / .env
Created June 11, 2021 21:42 — forked from djirdehh/.env
Sample .env file (without values) for client project after lesson 12.1 of Part II of the TinyHouse Fullstack React Masterclass.
PORT=
PUBLIC_URL=
DB_USER=
DB_USER_PASSWORD=
DB_CLUSTER=
G_CLIENT_ID=
G_CLIENT_SECRET=
SECRET=
NODE_ENV=
G_GEOCODE_KEY=