Skip to content

Instantly share code, notes, and snippets.

View kentcdodds's full-sized avatar
🤓
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
atty303 / .gitignore
Created May 31, 2011 07:42
Initial gitignore for iOS project.
# xcode noise
build/*
*.perspective
*.perspectivev3
*.pbxuser
*.xcworkspace
*.mode1
*.mode2v3
*.mode1v3
xcuserdata
@klamping
klamping / .profile
Created March 9, 2013 21:08
Common profile/bashrc settings
alias l="ls -al"
alias c="cd"
alias b="cd .."
alias bb="cd ../.."
# application aliases
alias v="vim"
alias vi="vim"
@geddski
geddski / service-demystification-test.js
Created June 19, 2013 16:40
Demystification of Angular's services.
var expect = chai.expect;
describe('services', function(){
var goat, monkey, monkey2, Donkey, tiger1, tiger2, lion;
beforeEach(function(){
//load the module
module('app');
//configure providers
// In v2/3 you did this:
import ReactDOM from 'react-dom'
import { Router, browserHistory, Route } from 'react-router'
ReactDOM.render(
<Router>
<Route path="/about" component={About}/>
<Route path="/:username" component={User}/>
</Router>
)
@getify
getify / 1.js
Last active October 15, 2017 01:35
generators as object iterator
// ugly way
var obj = {
a: 1,
b: 2,
c: 3,
[Symbol.iterator]() {
var keys = Object.keys(this);
var idx = 0;
return {
@kentcdodds
kentcdodds / kent-newsletters.json
Last active April 1, 2018 02:50
Where my stuff has been mentioned in newsletters (AFAIK). I'm planning on building something small with this eventually...
[
{
"link": "https://blog.kentcdodds.com/migrating-to-jest-881f75366e7e",
"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": "http://javascriptweekly.com/issues/310"
}
@leejsinclair
leejsinclair / protractor.conf.js
Last active August 19, 2018 06:25
Running protractor tests on codeship #testing #browser #selenium
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
elijahmanor / README.md
Last active November 8, 2018 19:34
Has Deprecated Packages

Feel free to run via...

npx https://gist.github.com/elijahmanor/4cc8e3eac9fb5999c5d759388ff27c64

@kentcdodds
kentcdodds / README.md
Created October 25, 2017 22:01
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!

Context

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

@kentcdodds
kentcdodds / control-props.js
Created April 2, 2019 16:05
An implementation of control props with hooks
// control props
import React from 'react'
import _ from 'lodash'
import {Switch} from '../switch'
const callAll = (...fns) => (...args) => fns.forEach(fn => fn && fn(...args))
const noop = () => {}
function toggleReducer(state, {type, initialState}) {