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 {
class Client { | |
constructor(foo) { | |
this.name = foo | |
} | |
} | |
class Message { | |
constructor(content) { | |
this.content = content | |
} |
// 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 |
{ | |
"name": "rollup-poc", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC" |
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; |
"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"); |
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", |
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(); |
license: gpl-3.0 |
{ | |
"v": 2, | |
"parserID": "babylon7", | |
"toolID": "jscodeshift", | |
"settings": { | |
"babylon7": null | |
}, | |
"versions": { | |
"babylon7": "7.3.1", | |
"jscodeshift": "0.6.3" |