Skip to content

Instantly share code, notes, and snippets.

Avatar

Austin Wood indiesquidge

  • San Francisco, CA
View GitHub Profile
@indiesquidge
indiesquidge / pull-request-template-proposal.md
Last active Mar 2, 2017
Ideas around the flow of PRs, how to request reviewers, and PR templates
View pull-request-template-proposal.md

Pull Requests & Reviews

Brief Background

People are far less inclined to "drudge" through a review if they have no clue or context as to what they are reviewing.

Details and descriptions are paramount for PRs that include things like lots of new logic, lots of deletions, and/or new files.

@indiesquidge
indiesquidge / objects-over-classes.md
Last active Aug 4, 2020
We are better off avoiding ES6 classes in JavaScript when possible
View objects-over-classes.md

Plain JavaScript objects are better than classes when they can be used, and many popular modern frameworks have adopted their use.

Consider that in React a component can be created as either a class or as an object.

// using a class
class Welcome extends React.Component {
  render() {
    <h1>Hello, {this.props.name}</h1>
@indiesquidge
indiesquidge / fire.html
Created Dec 12, 2016
first draft lo-fi fire animation
View fire.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Fire</title>
<style>
.fire-wrapper {
position: absolute;
top: 240px;
View add-eventing.js
const addEventing = function (obj) {
let events = {}
obj.on = (eventName, fn) => {
if (events[eventName]) {
events[eventName].push(fn)
} else {
events[eventName] = [fn]
}
}
@indiesquidge
indiesquidge / promise-dot-all.js
Last active May 27, 2020
Recreating Promise.all with async/await
View promise-dot-all.js
/*
Let us re-create `Promise.all`
`Promise.all` method returns a promise that resolves when all of the promises in the iterable argument have resolved,
or rejects with the reason of the first passed promise that rejects.
Read more about `Promise.all` on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
A basic example would be something like this:
@indiesquidge
indiesquidge / angular-translate-directive-on-label.md
Last active May 6, 2016
Limitations for the `angular-translate` directive when used on a label element with a nested input element
View angular-translate-directive-on-label.md

This may be more of a misunderstanding with my knowledge of how HTML works rather than a bug in angular-translate:

When I create a <label> that wraps an <input>

<label translate="APP.PURCHASE_ORDER_DETAILS.PURCHASE_ORDER_DETAILS_DIALOG.VENDOR_ID_INPUT_LABEL">
  <input class="vendor-id-input" type="text">
</label>
View high-performance-learning-references.md
@indiesquidge
indiesquidge / manual-git-flow.md
Last active May 1, 2020
Manual Git Flow for a Feature Branch from the CLI
View manual-git-flow.md

Manual Git Flow for a Feature Branch from the CLI

Brief Context

Back in 2010, Vincent Driessen wrote a post called A successful Git branching model. Besides being extremely well drafted and clear in it's intention, the post goes into great detail about Git branching strategies and release management. The model that Vincent (sobriquet "nvie") came up with was popularized as git-flow.

@indiesquidge
indiesquidge / angular-1-unit-testing-gotcha.md
Created Feb 9, 2016
Module Dependencies and Compiling in Unit Tests for Angular 1
View angular-1-unit-testing-gotcha.md

Module Dependencies and Compiling in Unit Tests for Angular 1

I was writing a test that would click on a checkbox element

describe(`checkbox unchecked`, () => {
    it(`should remove the answer if the checkbox is unchecked`, () => {
        var form = angular.element(`<form name="form">
                                        <div gi-checkbox-optional="answer"
                                             gi-form-model="form">
@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created Jan 19, 2016
how to access subdomains locally with Rails 5
View subdomain-localhost-rails-5.md

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
You can’t perform that action at this time.