Skip to content

Instantly share code, notes, and snippets.

@agustinustheo
agustinustheo / react-lerna-install-and-build.yml
Created November 6, 2022 04:27
GH Actions for Lerna and React
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Monorepo Code
uses: actions/checkout@v2
- name: Yarn Bootstrap
uses: borales/actions-yarn@v3.0.0
with:
cmd: bootstrap:ci # will run `yarn bootstrap:ci` command
@agustinustheo
agustinustheo / Dockerfile
Last active October 21, 2022 07:56 — forked from beeman/Dockerfile
Docker image with solana-test-validator that works on a Apple M1
FROM debian:bullseye as base
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
WORKDIR /workspace
RUN mkdir -pv "/workspace/bin" && echo 'echo test' > '/workspace/bin/test.sh' && chmod +x '/workspace/bin/test.sh'
ENV PATH="/workspace/bin:${PATH}"
FROM base as builder
@agustinustheo
agustinustheo / features-table.md
Last active October 16, 2022 11:45
Nest.js vs ASP.NET main features list.
Features Nest.js Package Made by ASP.NET Package Made by
Caching cache-manager Community Microsoft.Extensions.Caching.Memory Microsoft
Database access @nestjs/typeorm Nest.js Microsoft.AspNetCore.Identity.EntityFrameworkCore Microsoft
Authentication @nestjs/passport Nest.js Microsoft.AspNetCore.Authentication Microsoft
Task scheduling @nestjs/schedule Nest.js Cronos Community
Queues @nestjs/bull Nest.js System.Messaging Microsoft
Swagger @nestjs/swagger Nest.js Swashbuckle.AspNetCore.Swagger Community
WebSockets @nestjs/websockets Nest.js Microsoft.AspNetCore.WebSockets Microsoft
@agustinustheo
agustinustheo / on-trigger.yaml
Created October 4, 2022 15:02
GitHub Actions workflow that triggers push/pull requests to the main branch.
name: CI/CD Deploy Netlify Webapp Dev
on:
push:
branches: [ main ]
workflow_dispatch:
@agustinustheo
agustinustheo / package.json
Last active October 4, 2022 14:55
Root `package.json` file for Lerna
{
"name": "root",
"private": true,
"scripts": {
"lerna": "lerna",
"bootstrap:ci": "yarn --ignore-scripts --silent && lerna bootstrap -- --ignore-scripts && yarn build:ci",
"build:ci": "lerna run build"
},
"devDependencies": {
"lerna": "^5.1.4",
const EscrowContract = await hre.ethers.getContractFactory("Escrow");
const escrowContract = await EscrowContract.deploy(DAITokenAddress)
await escrowContract.deployed();
console.log('Contracts deployed!');
if (networkName == 'localhost') {
console.log('Deployed ERC20 contract address', erc20.address)
}
console.log('Deployed Escrow Contract address', escrowContract.address);
let DAITokenAddress = process.env[`${networkName.toUpperCase()}_NETWORK_DAI_TOKEN_ADDRESS`];
// If deploying to localhost, (for dev/testing purposes) need to deploy own ERC20
if (networkName == 'localhost') {
const ERC20Contract = await hre.ethers.getContractFactory("MockDaiToken");
erc20 = await ERC20Contract.deploy();
await erc20.deployed()
DAITokenAddress = erc20.address
}
const networkName = hre.network.name;
const networkUrl = hre.network.config.url;
console.log('Deploying to network', networkName, networkUrl);
const hre = require('hardhat');
require('dotenv').config();
async function main() {
// Insert your deployment script here
}
// We recommend this pattern to be able to use
// async/await everywhere and properly handle errors.
main()
.then(() => process.exit(0))
.catch((error) => {
require("@nomiclabs/hardhat-ethers");
require('dotenv').config();
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: "0.8.4",
networks: {
rinkeby: {
url: process.env.RINKEBY_RPC_URL,