Skip to content

Instantly share code, notes, and snippets.

View heathdrobertson's full-sized avatar
🏠
FIRE TAC 1

Heath Robertson heathdrobertson

🏠
FIRE TAC 1
View GitHub Profile
@heathdrobertson
heathdrobertson / Main.hs
Last active October 30, 2020 12:05
first_contract
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe
main :: IO ()
main = print . pretty $ contract
{- Define a contract, Close is the simplest contract which just ends the contract straight away
@heathdrobertson
heathdrobertson / SampleContract.sol
Last active May 26, 2020 16:15
Basic Solidity Contract Layout
pragma solidity >=0.4.21 <0.7.0;
// It's important to avoid vulnerabilities due to numeric overflow bugs
// OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs
// More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/\
// november/smart-contract-insecurity-bad-arithmetic/
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@Openzeppelin/contracts/access/Ownable.sol";
@heathdrobertson
heathdrobertson / 01_nixos_vim_container.md
Last active August 18, 2023 12:07
Setup Neovim using a NixOS Docker container.

Neovim IDE

Neovim IDE in a NixOS Docker Container

docker run --volumes-from=nix -it \
    -v $(pwd):/home \
    -w /home \
    --name <change-me> \
    -p 9005:9005 \
 -p 3000:3000 \
with import <nixpkgs> {};
# with pkgs;
stdenv.mkDerivation {
name = "ipfsenv";
buildInputs = [ipfs];
shellHook = ''
ipfs init
@heathdrobertson
heathdrobertson / build.nix
Created December 3, 2019 18:02
Building an Ethereum Dapp development container with Nix Shell.
with import <nixpkgs> {};
# with pkgs;
stdenv.mkDerivation {
name = "dapp_monkey";
buildInputs = [python37 nodejs];
shellHook = ''
npm install body-parser express morgan nodemon web3
@heathdrobertson
heathdrobertson / node_express.nix
Last active November 27, 2019 22:37
Node.js & Express Framework
with import <nixpkgs> {};
# with pkgs;
stdenv.mkDerivation {
name = "Express API";
buildInputs = [python37 nodejs];
shellHook = ''
npm install bitcoin-core bitcoinjs-lib bitcoinjs-message body-parser crypto-js express hex2ascii morgan nodemon
@heathdrobertson
heathdrobertson / design_notes_adobe.md
Last active November 30, 2019 13:04
Design project notes. Illustrator, Photoshop, After Effects, Premiere

Premiere

After Effects

Illustrator

Photoshop

Acrobat

@heathdrobertson
heathdrobertson / cowsay.nix
Created November 14, 2019 01:17
A sample container expossing a running Nix shell.
# This imports the nix package collection,
# so we can access the `pkgs` and `stdenv` variables
with import <nixpkgs> {};
# Make a new "derivation" that represents our shell
stdenv.mkDerivation {
name = "haskell_env";
# The packages in the `buildInputs` list will be added to the PATH in our shell
buildInputs = [
@heathdrobertson
heathdrobertson / haskell.nix
Last active November 14, 2019 01:10
A Haskell environment built with a Nix shell.
{ nixpkgs ? import <nixpkgs> {} }:
let
inherit (nixpkgs) pkgs;
inherit (pkgs) haskellPackages;
haskellDeps = ps: with ps; [
base
lens
mtl
];
" Neovim Plugins https://github.com/neovim/neovim/wiki/Related-projects#plugins
" vim-plug Plugin Manager - https://github.com/junegunn/vim-plug#usage
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - For Vim: ~.vim/plugged
" - Avoid using standard Vim directory names like 'plugin'
" - Reload .vimrc and :PlugInstall to install plugins.
call plug#begin('~/.local/share/nvim/plugged')
" Make sure you use single quotes