Solutions to problems or quirks I shouldn't have.
Stack overflow in React (`Maximum call stack size exceeded`)
Triggered this one a week ago with something like the following (pseudocode):class MyComponent extends React.Component {| function debug(fn) { | |
| return function () { | |
| console.groupCollapsed(fn.name); | |
| console.debug('Args:', arguments); | |
| const result = fn.apply(this, arguments); | |
| console.debug('Returns:', result); | |
| console.groupCollapsed('Stack'); | |
| console.log(new Error().stack.split('\n').slice(1).join('\n')); | |
| console.groupEnd(); | |
| console.groupEnd(); |
| resource "aws_api_gateway_rest_api" "myApi" { | |
| name = "myApi-${var.env}" | |
| description = "My awesome API (${var.env} environment)" | |
| } | |
| resource "aws_api_gateway_deployment" "myApi" { | |
| depends_on = [ | |
| "aws_api_gateway_integration.myApi_myEndpoint_post", | |
| "aws_api_gateway_integration_response.myApi_myEndpoint_post", | |
| "aws_api_gateway_integration_response.myApi_myEndpoint_post_400", |
| "use strict" | |
| const Nightmare = require("nightmare"); | |
| const expect = require("chai").expect; | |
| const budo = require("budo"); | |
| describe("\u263C basic tests \u263E", () => { | |
| const b = budo("../src/main.js"); |
| import React from 'react'; | |
| /** | |
| * @param {number} t Number between 0 and 1 indicating the progress of the ease. | |
| * @param {number} startValue | |
| * @param {number} endValue | |
| */ | |
| function easeOut(t, startValue, endValue) { | |
| const c = endValue - startValue; | |
| const p = t - 1; |
| { | |
| "name": "rollup-poc", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "author": "", | |
| "license": "ISC" |
| // this is an ingenius hack that allows us to run Phaser without a browser | |
| // ... and yes, it took some time to figure out how to do this | |
| var Canvas = require('canvas') | |
| , jsdom = require('jsdom') | |
| , document = jsdom.jsdom(null) | |
| , window = document.parentWindow | |
| , Phaser; | |
| // expose a few things to all the modules |
| class Client { | |
| constructor(foo) { | |
| this.name = foo | |
| } | |
| } | |
| class Message { | |
| constructor(content) { | |
| this.content = content | |
| } |
| # Your keymap | |
| # | |
| # Atom keymaps work similarly to style sheets. Just as style sheets use | |
| # selectors to apply styles to elements, Atom keymaps use selectors to associate | |
| # keystrokes with events in specific contexts. Unlike style sheets however, | |
| # each selector can only be declared once. | |
| # | |
| # You can create a new keybinding in this file by typing "key" and then hitting | |
| # tab. | |
| # |
From Stack Overflow.
# Fetch the submodule commits into the main repository
git remote add submodule_origin git://url/to/submodule/origin
git fetch submodule_origin
# Start a fake merge (won't change any files, won't commit anything)
git merge -s ours --no-commit submodule_origin/master