This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef } from 'react'; | |
/** | |
* A small utility hook to help figure out what is changing and causing | |
* re-renders. Add it to the component you're investigating and pass in a object | |
* of the values that you think might be changing. | |
* | |
* Ex: useWhatChanged({ someProp, someOtherProp }); | |
*/ | |
export function useWhatChanged(props) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git | |
alias gs="git status" | |
alias gc="git checkout" | |
alias gcb="git checkout -b" | |
alias gb="git branch" | |
alias gprom="git pull --rebase origin master" | |
alias gprum="git pull --rebase upstream master" | |
alias gl="git log" | |
alias glp="git log --decorate --pretty=oneline" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
/*! | |
* @overview Ember - JavaScript Application Framework | |
* @copyright Copyright 2011-2017 Tilde Inc. and contributors | |
* Portions Copyright 2006-2011 Strobe Inc. | |
* Portions Copyright 2008-2011 Apple Inc. All rights reserved. | |
* @license Licensed under MIT license | |
* See https://raw.github.com/emberjs/ember.js/master/LICENSE | |
* @version 2.14.0-alpha.1-ember-testing+df839ae1 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RSVP from 'rsvp'; | |
import Ember from 'ember'; | |
const RETRY_LOAD = Symbol('RETRY_LOAD'); | |
function createLoadElement(tag, load, error) { | |
const el = document.createElement(tag); | |
el.onload = load; | |
el.onerror = error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add the `before` hook | |
QUnit.moduleStart(function() { | |
// QUnit is weird in that once a module starts, it is considered the `previousModule` and not the `currentModule`. | |
let previousModule = QUnit.config.previousModule; | |
let testEnvironment = previousModule && previousModule.testEnvironment; | |
let before = testEnvironment && testEnvironment.before; | |
// If the module has a `before` function, call it with the `testEnvironment` as the context. | |
if (before && typeof before === 'function') { | |
before.call(testEnvironment); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var snowflakes = [], | |
moveAngle = 0, | |
animationInterval; | |
/** | |
* Generates a random number between the min and max (inclusive). | |
* @method getRandomNumber | |
* @param {Number} min | |
* @param {Number} max |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Plax = function() { | |
var plax = document.querySelectorAll('.plax'); | |
for (var i=0; i<plax.length; i++) { | |
plax[i].style.position = 'fixed'; | |
} | |
document.onscroll = function() { | |
for (var i=0; i<plax.length; i++) { | |
plax[i].style.top = (-plax[0].getAttribute('data-plax') * document.body.scrollTop) + 'px'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.onscroll = function() { | |
document.body.style.transition = 'opacity 1s'; | |
document.body.style.opacity = '0'; | |
} |