- Avoid using
PropTypes.string
for a prop that sets a type/variation, usePropTypes.oneOf(CONSTANT)
instead:
// BAD:
Button.propTypes = {
size: React.PropTypes.string
};
// Good:
// A saga that looks for a route change request in every action. Example usage: | |
// export const selectConversation = ({ id }) => ({ | |
// type: SELECT_CONVERSATION, | |
// payload: { | |
// conversationId: id, | |
// }, | |
// meta: { | |
// redirect: { | |
// url: `inbox/${id}`, // <-- the saga will redirect to this url | |
// replace: true, // <-- if the route should be replaced or pushed on top of the history stack |
This transform was created to programmatically add metadata to all ESLint rules (#5417).
here's a live example for the no-trailing-spaces
rule.
Please note:
whitespace
. This is not true for 4 rules, which were fixed manually afterwards:
semi
no-extra-semi
(function( factory ) { | |
// if require js is available use it to define jquery and require it. | |
if ( typeof define === 'function' && define.amd ) { | |
define( ['jquery'], factory ); | |
} else if ( typeof module !== 'undefined' && module.exports ) { | |
var jQuery = require('jquery'); | |
module.exports = factory( $ ); | |
} else { | |
window.YourModule = factory( $ ); | |
} |
[ Launch: Tributary inlet ] 4948108 by vitorbal
[ Launch: rank bar chart ] 4729900 by vitorbal
$(document).ready(function() { | |
var prefix = "https://gist.github.com/"; | |
$('a[href^="' + prefix + '"]').each(function(i) { | |
var $anchor = $(this), | |
$el = $("<p></p>"); | |
$anchor.replaceWith($el); | |
writeCapture.html($el, '<script src="'+$anchor.text()+'.js"></scr' + 'ipt>'); | |
$anchor.remove(); | |
}); | |
}); |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/eojssfq/QG5m6cm3z/embedgist.js"></script> |
class RenderMovieShowTimes(webapp.RequestHandler): | |
def get(self, cityid, movieid): | |
# cityid and movieid will contain the passed variables | |
# do something with them | |
application = webapp.WSGIApplication([ '/([^/]+)/([^/]+)' ]) | |
def main(): | |
run_wsgi_app(application) |