Skip to content

Instantly share code, notes, and snippets.

working hard to make the world better with software

Kent C. Dodds kentcdodds

working hard to make the world better with software
View GitHub Profile
atty303 / .gitignore
Created May 31, 2011
Initial gitignore for iOS project.
View .gitignore
# xcode noise
klamping / .profile
Created Mar 9, 2013
Common profile/bashrc settings
View .profile
alias l="ls -al"
alias c="cd"
alias b="cd .."
alias bb="cd ../.."
# application aliases
alias v="vim"
alias vi="vim"
geddski / service-demystification-test.js
Created Jun 19, 2013
Demystification of Angular's services.
View service-demystification-test.js
var expect = chai.expect;
describe('services', function(){
var goat, monkey, monkey2, Donkey, tiger1, tiger2, lion;
//load the module
//configure providers
View SimpleReactRouterUpgrade.js
// In v2/3 you did this:
import ReactDOM from 'react-dom'
import { Router, browserHistory, Route } from 'react-router'
<Route path="/about" component={About}/>
<Route path="/:username" component={User}/>
getify / 1.js
Last active Oct 15, 2017
generators as object iterator
View 1.js
// ugly way
var obj = {
a: 1,
b: 2,
c: 3,
[Symbol.iterator]() {
var keys = Object.keys(this);
var idx = 0;
return {
kentcdodds / with-foo.js
Created Nov 15, 2017
Which of these is a higher order component?
View with-foo.js
// Which of these things is the "Higher Order Component?"
function withFoo(Component) { // <-- this is a function, not a component
class Wrapper extends React.Component { // <-- this is a component
static displayName = `withFoo(${Component.displayName ||})`
static propTypes = {innerRef: PropTypes.func}
static WrappedComponent = Component
render() {
const {innerRef, ...remainingProps} = this.props
return <Component {...remainingProps} foo="FOO!" ref={innerRef} />
kentcdodds / kent-newsletters.json
Last active Apr 1, 2018
Where my stuff has been mentioned in newsletters (AFAIK). I'm planning on building something small with this eventually...
View kent-newsletters.json
"link": "",
"title": "Migrating to Jest",
"comment": "Kent C. Dodds is super excited about Jest as an alternative to AVA and Mocha, and explains how he was won over after not initially being a fan.",
"newsletter": {
"name": "JavaScript Weekly",
"issue": 310,
"link": ""
leejsinclair / protractor.conf.js
Last active Aug 19, 2018
Running protractor tests on codeship #testing #browser #selenium
View protractor.conf.js
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
// 'browserName': 'internet explorer', - special installation needed
// 'version':'10',
'browserName': 'chrome',
//'browserName': 'firefox'
elijahmanor /
Last active Nov 8, 2018
Has Deprecated Packages

Feel free to run via...


kentcdodds /
Created Oct 25, 2017
Rendering a function with React

Rendering a function with React

No, this isn't about render props

I'm going to clean this up and publish it in my newsletter next week!


So react-i18n (not the npm one... one we made at PayPal internally) has this