Skip to content

Instantly share code, notes, and snippets.

@erickeno
erickeno / FormExample.re
Created February 25, 2020 16:03 — forked from busypeoples/FormExample.re
Form Example in ReasonML
type validation('a) =
| NotEmpty
| Custom('a);
type t = string;
let validate = (rule, value, values) =>
switch (rule) {
| NotEmpty => String.length(value) > 0
| Custom(fn) => fn(value, values)
@erickeno
erickeno / A.markdown
Created December 26, 2019 23:07 — forked from larrybotha/A.markdown
XState + AWS Amplify example

XState + AWS Amplify example

A breakdown of a project that uses XState to manage state for authenticating a user with Cognito, and then finding the authorized application user with an invoked machine.

  1. create auth machine
  2. create auth context
  3. handle AWS authentication
  4. once user authenticates with Cognito, redirect to user route to get user from db
  5. at user route use userMachine service from authMachine to get application user
  6. once associated application user is found, send user to organization route to allow user to associate session with specific organization
@erickeno
erickeno / aws-ecs-deploy-permissions.md
Created July 10, 2018 21:41 — forked from duluca/aws-ecs-deploy-permissions.md
npm scripts for AWS ECS (Blue-Green Deployment)

AWS ECS Deploy Permissions

In order to be able to deploy using the scripts provided by npm scripts for AWS ECS make sure your user is part of an IAM Group that has the following inline policy applied to it.

Note: This may not be complete.

{
    "Version": "2012-10-17",
    "Statement": [
@erickeno
erickeno / Nav.js
Created June 8, 2017 05:05 — forked from michaelgmcd/Nav.js
Sticky navbar in React.js
var React = require('react');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var cx = require('classnames');
var Nav = React.createClass({
componentDidMount: function() {
if (ExecutionEnvironment.canUseDOM) {
window.addEventListener('scroll', this.handleScroll, false);
}
},
@erickeno
erickeno / appspec.yml
Created May 11, 2017 18:36 — forked from moshest/appspec.yml
Node.js Project on AWS CodeDeploy CentOS
version: 0.0
os: linux
files:
- source: /
destination: /home/ec2-user/node
permissions:
- object: /home/ec2-user
owner: ec2-user
group: ec2-user
type:
@erickeno
erickeno / .gitconfig
Created October 5, 2016 19:13 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@erickeno
erickeno / DropZone.jsx
Created August 18, 2016 05:05 — forked from pizzarob/01_DropZone.jsx
HTML5 Drag and Drop React Component
import React, {PropTypes} from 'react';
import classNames from 'classnames';
class BatchDropZone extends React.Component {
static propTypes = {
// function that recieves an array of files
receiveFiles: PropTypes.func.isRequired,
@erickeno
erickeno / backgroudAnimation.css
Created August 10, 2016 22:04 — forked from anonymous/my.css
CSS Gradient Animation
background: linear-gradient(232deg, #4bcf93, #4b79cf, #a24bcf);
background-size: 600% 600%;
-webkit-animation: AnimationName 32s ease infinite;
-moz-animation: AnimationName 32s ease infinite;
-o-animation: AnimationName 32s ease infinite;
animation: AnimationName 32s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/page.css">
<title>CSS3</title>
</head>
<body>
@erickeno
erickeno / index.html
Created April 19, 2013 23:25 — forked from anonymous/index.html
transition with cubic-bezier property
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/page.css">
<title>CSS3</title>
</head>
<body>