Skip to content

Instantly share code, notes, and snippets.

View migcarva's full-sized avatar

Miguel Carvalho migcarva

View GitHub Profile
@migcarva
migcarva / semantic-commit-messages.md
Created February 19, 2020 17:38 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@migcarva
migcarva / postgres-brew.md
Created October 4, 2019 14:00 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@migcarva
migcarva / postgres-brew.md
Created October 4, 2019 14:00 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@migcarva
migcarva / index.html
Created August 19, 2019 10:13
Custom and Accessible Checkbox
<div>
<input type="checkbox" id="checkbox" name="checkbox" value="custom and accessible" checked>
<label for="checkbox">Custom and Accessible</label>
</div>

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps

  1. what is a parser?
  2. and.. what is a parser combinator?

So first question: What is parser?

@migcarva
migcarva / combinators.js
Created February 28, 2018 14:51 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));
@migcarva
migcarva / tmux-cheatsheet.markdown
Created December 4, 2017 15:01 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@migcarva
migcarva / login.js
Last active November 3, 2017 20:56
state machine implementation of a login component
const machine = {
currentState: 'login form',
states: {
'login form': {
submit: 'loading'
},
'loading': {
success: 'profile',
failure: 'error'
},
@migcarva
migcarva / tab-trigger.js
Created October 26, 2017 20:58 — forked from wesbos/tab-trigger.js
How to properly get a TAB trigger working with Emmet inside of JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@migcarva
migcarva / gist:633a81f83e1d8bb16d6a7a812ab5a44d
Created October 23, 2017 09:47
Redux in a big sentence!
Redux is a JavaScript library that aims to simplify how we manage stateful data. Redux keeps all of our data in a single JS object called the Store. A single function, the reducer, is responsible for making modifications to the Store. We trigger the reducer by 'dispatching' an action - a JS object that describes how our data should change. The reducer function receives the action as an argument and makes changes accordingly. Other parts of the code (usually React Components) can subscribe to data in the Store. When data changes, Redux notifies subscribers of the change.