Skip to content

Instantly share code, notes, and snippets.

@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@vincentaudebert
vincentaudebert / SegmentedControl.js
Created October 31, 2016 22:50
Radio Buttons renderer
import React, { PropTypes } from 'react';
const SegmentedControl = ({ input, disabled, heading, required, className, items, name, meta: { touched, error } }) => (
<fieldset className={`form__field ${className || ''}`}>
<legend className="form__label">
{heading}{required ? (<span>*</span>) : null}
{ (touched && error) ? (
<span className="form__error"> {error}</span>
) : null }
@samme
samme / phaser-sprite-lifecycle.md
Last active September 2, 2017 10:30
Phaser Sprite Lifecycle
alive exists fresh health renderable visible
sprite.exists = false
sprite.exists = true ✔️ ✔️
sprite.kill()
sprite.revive(…) ✔️ ✔️ 1* ✔️
sprite.reset(…) ✔️ ✔️ ✔️ 1* ✔️ ✔️
group.create(…) ✔️* ✔️* ✔️*
group.createMultiple(…) ❌* ❌* ❌*
group.resetChild(…, x, y) ✔️ ✔️ ✔️ 1 ✔️ ✔️
@lqd
lqd / gist:1c841dea193698bf50fefa19c6b3fb99
Last active December 10, 2023 19:17
Some of my favorite development streams and shows
Why coding streams/shows are interesting to me: in some livestreams, the experience is very similar to pair programming,
but those people are experts. In VODs, it's more about problem solving and learning skills and approaches. The devs are really good
at what they do and there is *always* a lot to learn.
In no particular order:
1) Handmade Hero
About the author: Casey Muratori. Worked at RAD.
Description and why I like it: It kinda started the whole thing for me. Casey is coding a complete game and engine on stream,
from scratch, one hour a day. He knows what he's doing on so many of the domains of game development and regular programing,
@bkaradzic
bkaradzic / orthodoxc++.md
Last active November 15, 2024 12:57
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@noromanba
noromanba / twitch-irc-with-weechat.mkd
Last active January 24, 2024 01:17
How to join Twitch IRC w/ WeeChat
@learncodeacademy
learncodeacademy / pubsub.js
Created July 29, 2015 02:54
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@wosephjeber
wosephjeber / ngrok-installation.md
Last active November 14, 2024 09:06
Installing ngrok on Mac

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above:

@oliverbenns
oliverbenns / console-log.sublime-snippet
Last active August 29, 2015 14:17
Console Log Sublime Text 3 Snippet. Allows the logged value to have the stringified version before it.
<snippet>
<content><![CDATA[console.log('$1', $1);]]></content>
<tabTrigger>log</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>