Skip to content

Instantly share code, notes, and snippets.

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
Initial gitignore for iOS project.
View .gitignore
# xcode noise
build/*
*.perspective
*.perspectivev3
*.pbxuser
*.xcworkspace
*.mode1
*.mode2v3
*.mode1v3
xcuserdata
@klamping
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
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;
beforeEach(function(){
//load the module
module('app');
//configure providers
View SimpleReactRouterUpgrade.js
// 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 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
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 || Component.name})`
static propTypes = {innerRef: PropTypes.func}
static WrappedComponent = Component
render() {
const {innerRef, ...remainingProps} = this.props
return <Component {...remainingProps} foo="FOO!" ref={innerRef} />
@kentcdodds
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": "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 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
elijahmanor / README.md
Last active Nov 8, 2018
Has Deprecated Packages
View README.md

Feel free to run via...

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

@kentcdodds
kentcdodds / README.md
Created Oct 25, 2017
Rendering a function with React
View README.md

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