This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
from django.db.models.signals import post_init | |
def track_data(*fields): | |
""" | |
Tracks property changes on a model instance. | |
The changed list of properties is refreshed on model initialization | |
and save. | |
>>> @track_data('name') |
# A module that allows us to send Backbone events up the tree of components | |
ReactTelegraph = | |
componentWillMount: -> | |
# Make BB events available to the component | |
_.extend @, Backbone.Events | |
componentWillUnmount: -> | |
# Remove all Backbone event listeners | |
@off null, null, null | |
var UndoMixin = { | |
getInitialState: function() { | |
return { | |
undo: [] | |
}; | |
}, | |
handleUndo: function() { | |
if (this.state.undo.length === 0) { | |
return; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
The MIT License (MIT) | |
Copyright (c) 2014 Tomas Kafka | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
class DisableMigrations(object): | |
def __contains__(self, item): | |
return True | |
def __getitem__(self, item): | |
return "notmigrations" | |
MIGRATION_MODULES = DisableMigrations() |
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
Why would you want to do this? Because you often don't need more. It's nice to not have to think about your "router" as this big special thing.
Instead, with this approch, your app's current pathname
is just another piece of state, just like anything else.
This also means that when doing server-side rendering of a redux app, you can just do:
var app = require('your/redux/app')
var React = require('react')