Skip to content

Instantly share code, notes, and snippets.

@andrewgrewell
andrewgrewell / .gitignore
Created May 20, 2020 01:01
Unity .gitignore Template
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
@andrewgrewell
andrewgrewell / osx_bootstrap.sh
Last active August 28, 2020 18:40 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Notes:
#
# - If installing full Xcode, it's better to install that first from the app
# store before running the bootstrap script. Otherwise, Homebrew can't access
@andrewgrewell
andrewgrewell / gist:b04b347c4d2783645285
Created February 3, 2016 21:54
React-Router 1.0.0+ async onEnter in IE7 fix
/*
Issue: If a component with an asyn onEnter (for example implementing a willTransitionTo type behavior) is rendered in IE7
React will throw an error about not being able to locate a dom node, (in this case it is the root route).
Reason: React-Router passes null to React while it is waiting for the async onEnter callback to be called. When React gets
a null value it instead renders an element with a tag of <noscript>. the <noscript> tag was not showing up in the element
that React was rendering into, not sure why this is though
Fix: instead of returning <noscript> return an empty <span>. We are using webpack so this was done by parsing the source
and specificly replacing the ReactInjection.EmptyComponent.injectEmptyComponent('noscript'); call
@andrewgrewell
andrewgrewell / Animate-Container-Height-Change.markdown
Last active August 29, 2015 14:19
Animate Container Height Change

Animate Container Height Change

A better solution for animating a change in an elements height when children are added.

SANS REACT: Without react this is usually done by adding the child to the DOM in such a way that it doesn't effect the positioning of existing elements, measure its height and use that info to animate the parent to a new height.

THE REACT WAY: By using React we can respond to changes in an elements children and adjust the height of the parent accordingly.

@andrewgrewell
andrewgrewell / Sass Compass Animation Mixin
Last active August 29, 2015 14:14
config-animation mixin for sass/compass
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
@import "compass/css3/animation";
// Helpful for when you want an animation shorthand mixin that wont overwrite previous properties.
// If you don't care about overwriting previous properties just use Compass animation()
@andrewgrewell
andrewgrewell / Variable Font Icon Mixin
Last active August 29, 2015 14:14
Variable Font Icon Mixin
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
@mixin variable-icon-font($icon-code) {
content: #{"\"\\"}#{$icon-code + "\""};
}