Skip to content

Instantly share code, notes, and snippets.

View moodmosaic's full-sized avatar

Nikos Baxevanis moodmosaic

View GitHub Profile
cryptoscopia / dydxFlashLoanTemplate.sol
Created October 21, 2020 06:42
A single-file simplest possible template for a contract that obtains a flash loan from dydx, does things, and pays it back.
View dydxFlashLoanTemplate.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
// The ABI encoder is necessary, but older Solidity versions should work
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// These definitions are taken from across multiple dydx contracts, and are
// limited to just the bare minimum necessary to make flash loans work.
library Types {
enum AssetDenomination { Wei, Par }

Since macOS Catalina, the root drive is read-only. The solution is to create a separate APFS volume and a “synthetic” /nix directory which points to it:

# Check if /nix exists, if not:
echo 'nix' | sudo tee -a /etc/synthetic.conf
# this will create a "synthetic" empty directory /nix

# REBOOT so macOS sees the synthetic directory

# After rebooting, create an APFS volume for Nix
owickstrom / HiggledyHedgehog.hs
Created July 1, 2019 19:37
Defining overridable default generators for Hedgehog using Higgledy
View HiggledyHedgehog.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TypeApplications #-}
module HiggledyHedgehog where
import Control.Lens
import Data.Generic.HKD
import GHC.Generics (Generic)
import Hedgehog