Skip to content

Instantly share code, notes, and snippets.

View indiesquidge's full-sized avatar

Austin Wood indiesquidge

View GitHub Profile
@indiesquidge
indiesquidge / pull-request-template-proposal.md
Last active March 2, 2017 00:29
Ideas around the flow of PRs, how to request reviewers, and PR templates

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 January 17, 2024 09:30
We are better off avoiding ES6 classes in JavaScript when possible

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() {
 Hello, {this.props.name}
@indiesquidge
indiesquidge / fire.html
Created December 12, 2016 06:04
first draft lo-fi fire animation
<!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;
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 January 20, 2024 15:03
Recreating Promise.all with async/await
/*
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 23:09
Limitations for the `angular-translate` directive when used on a label element with a nested input element

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>
@indiesquidge
indiesquidge / manual-git-flow.md
Last active May 1, 2020 11:16
Manual Git Flow for a Feature Branch from the CLI

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 February 9, 2016 23:19
Module Dependencies and Compiling in Unit Tests for Angular 1

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"&gt;
@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created January 19, 2016 07:42
how to access subdomains locally with Rails 5

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