Skip to content

Instantly share code, notes, and snippets.

View MitchPierias's full-sized avatar

Mitch Pierias MitchPierias

View GitHub Profile
@MitchPierias
MitchPierias / simple-gh-actions-pipeline.yml
Last active July 12, 2020 00:59
A simple GitHub Actions setup to get your static site continuous integration and deployment piepline started
name: Piepline
on:
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
class [[eosio::contract("example")]] example : public contract {
public:
using contract::contract;
[[eosio::action]] void post(const name author, const string message) {
require_auth(author);
message_table messages(_self, _self.value);
messages.emplace(author, [&](auto &post) {
post.id = messages.available_primary_key();
post.body = message;
#include <eosio/eosio.hpp>
#include <string>
using namespace eosio;
using namespace std;

This is a rough project flow we use when taking on new tasks;

  1. Build your UI elements (Storybook) or adjustments based on any mocks in your card.
  2. Integrate elements into the application, making it a dynamic component.
  3. Create tests and run localized testing on all files you've touched yarn test:all --watch ~/path/to/file --coverage false
  4. Turn coverage on and address missing lines in your tests yarn test:all --watch ~/path/to/file --coverage. You might need to add --updateSnapshot to your local tests if you've modified the outputted component and receive snapshot errors.

Alternate back and forth between addressing coverage and fixing tests until all local tests pass.5. Once everything passes locally and coverage is high, run a unit test on the entire project

@MitchPierias
MitchPierias / react-animations.md
Last active April 15, 2019 05:40
Animations in React

Animations in React

Avoid using props to continuously update components

The Wrong Way

Before we talk about the right way, let's talk a little bit about how you should not handle animations in React.

References

Use React.createRef to animate elements and then trigger a component on complete.

Context, not Redux

@MitchPierias
MitchPierias / aws-kubernetes-setup.md
Last active April 2, 2019 13:07
Kubernetes Setup for MacOS

Amazon AWS Kubernetes Setup

Amazon's manage Kubernetes service, EKS, uses kubectl along with aws-iam-authenticator extension for clsuter authentication. This gist assumes you have the AWS command line tools and SDK already installed and configured. The aws-iam-authenticator uses the same AWS credential provider chain shared by aws-cli and aws-sdk. To check the configured credentials, run

aws sts get-caller-identity

Installation

Download and install Kubernetes Kubernetes download and install instructions

@MitchPierias
MitchPierias / arangodb-ec2-linux.md
Last active December 9, 2022 21:32
Deploying ArnagoDB to an EC2 Linux Instance

ArangoDB Deployment to EC2 Linux Instance

Quickly get an ArangoDB instance running on an Amazon EC2 Linux Instance

Update existing package list and then install prerequieites.

sudo yum update -y

If your running a regular amazon linuz instance

sudo yum install docker
@MitchPierias
MitchPierias / nginx-reverse-proxy-for-docker.md
Created March 18, 2019 14:33
Nginx Reverse Proxy for Docker

Nginx reverse proxy for Docker

This was created to help expose ports for an ArangoDB container running on a Ubuntu EC2 instance

For this example, let's assume the container we want to expose is called arangodb-instance, our Nginx instance will be nginx, and our network will be called reverse-proxy. Start by creating our new network.

docker network create reverse-proxy

Next we need to connect our network to the exisitng container we would like to expose.

If you are using homebrew, then you can install the latest released stable version of ArangoDB using brew as follows:

brew install arangodb

This will install the current stable version of ArangoDB and all dependencies within your Homebrew tree. Note that the server will be installed as:

/usr/local/Cellar/arangodb/3.4.0/sbin/arangod

You can start the server by running the command:

@MitchPierias
MitchPierias / ArangoDB-EC2-Deployment-Docker.md
Last active December 17, 2020 14:57
ArangoDB Deployment to EC2 with Docker

ArangoDB Deployment to EC2

Install Docker

Update exisitn gpackage list and then install prerequieites.

sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common

Install GPG for the offical Docker release;