This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/.git-completion.sh | |
source ~/.git-prompt.sh | |
export PS1='\n\n\[\e[0;36m\][ \[\e[0;35m\]\w\[\e[0;36m\] ] $(__git_ps1 "\[\e[1;33m\]%s\[\e[0;36m\]") >\[\e[0m\] ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__gitdir () | |
{ | |
# Note: this function is duplicated in git-completion.bash | |
# When updating it, make sure you update the other one to match. | |
if [ -z "${1-}" ]; then | |
if [ -n "${__git_dir-}" ]; then | |
echo "$__git_dir" | |
elif [ -n "${GIT_DIR-}" ]; then | |
test -d "${GIT_DIR-}" || return 1 | |
echo "$GIT_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bash | |
# | |
# bash/zsh completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// one | |
[].each(function (foo) { | |
return foo.info ? "hello" : "hi"; | |
}); | |
// two | |
[].each(function (foo) { | |
return foo.info ? "hello" : "hi"; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// const AppDispatcher =, etc... | |
module.exports = { | |
getCommentsForRequestWithBind(requestID, rowBusinessKey) { | |
superagent.get(`/api/${requestID}/comments`, this.updateRequestCommentsInRow.bind(this, requestID, rowBusinessKey), someGlobalErrorAction); | |
}, | |
getCommentsForRequestLambda(requestID, rowBusinessKey) { | |
superagent.get(`/api/${requestID}/comments`, comments => this.updatedRequestCommentsInRow(requestID, rowBusinessKey, comments), someGlobalErrorAction); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// imports & variables, etc | |
ReactDOM.render( | |
<Localization messageBundle={{ foo: 'Welcome', bar: 'This is', baz: 'a website' }}> | |
<Provider store={Store}> | |
<Router history={history}> | |
<Route path="/" component={SomeParentRenderingGrandchildrenThatWantLocalizedStrings}> | |
</Router> | |
</Provider> | |
</Localization>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// parent A wants to show a list | |
<GetLastNImagesOfType type="jpg" numImages={10}> | |
{(images) => { | |
return images.map(image => <span>{image.name}</span>) | |
}} | |
</GetLastNImagesOfType> | |
// parent B wants to show the images themselves | |
<GetLastNImagesOfType type="jpg" numImages={10}> | |
{(images) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import B from './ComponentB-map.jsx'; | |
export default const A = React.creatClass({ | |
render() { | |
const { wrapperStyle, BStyleMap } = this.props.style; | |
// now you have to grok A's map, as well as B's map _and_ hope B has a map that supports the | |
// customization that you would want B to support when in this A context | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const API = ({ match, data }) => { | |
// this i left as is | |
const { params: { mod, header, environment } } = match; | |
const doc = data.api.find(doc => mod === doc.title.slug); | |
// don't mind the tern here as much, maybe would split the find to its own `validDocHeaderMatch` | |
const validHeader = doc && (header ? !!doc.headers.find(h => h.slug === header) : true ); | |
// this is my 😍 for conditional JSX thus far | |
return <Block> | |
{!doc && <Redirect to={`/${environment}`}/>} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Component from './Component.jsx'; | |
export default class App extends React.Component { | |
render() { | |
return <Component options={{ autoplay: true }}> | |
{(status, video) => { | |
// this error is being caught in the promise in component render, even though |
OlderNewer