- "Print boarding pass" button does not work
- Uses Flash
- Non-native experience (weird scrolling, input fields, etc)
- Doesn't work on my phone
- Have to identify myself even though I'm already logged in on your website
- Too many steps, show my boarding pass on first screen
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
var user = new User(); | |
user.set("name", "parshap"); | |
user.age("age", 5); | |
// Only save "name" to Mongo - leave "age" as a modified path in the docuemnt | |
user.save(["name"], function(err) { | |
// ... | |
}) |
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
"use strict"; | |
var type = require("core-util-is"); | |
var slice = Array.prototype.slice; | |
// Return a className string from the given arguments | |
// | |
// Example: | |
// | |
// classes("foo", "bar") -> "foo bar" |
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
/** @jsx React.DOM */ | |
"use strict"; | |
// An <input /> component that applies a format function to the value | |
// on initial render and when the element loses focus. | |
// | |
// Usage: | |
// | |
// <FormattedInput format={Math.round} valueLink={this.linkState("value")} /> | |
// |
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
function myCallback() { | |
console.log(foo); // undefined | |
} | |
function dothing(callback) { | |
var foo = "hello"; | |
callback(); | |
} |
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
"use strict"; | |
// A function that wraps a given `React.DOM.input`-like component to | |
// apply formatting to the value for display purposes. | |
// | |
// Example: | |
// | |
// var RoundedInput = createFormattedInput(React.DOM.input, { | |
// set: Math.round, | |
// }); |
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
var React = require("react"); | |
var TabbedComponent = React.createClass({ | |
render: function() { | |
return TabsContainer({ | |
tabs: [ | |
// Pass instantiated component? | |
this.renderTab1(), | |
// Or pass function to create component? | |
this.renderTab1, |
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
var a = [ | |
1, | |
2, | |
3, // <-- Trailing comma for easier future edits | |
]; | |
// No trailing comma, adding a 4th element will require editing two lines | |
var b = [ | |
1, | |
2, |
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
var mongoose = require("mongoose"); | |
var schema = new mongoose.Schema({ | |
nestedProp: { | |
bar: String, | |
baz: String, | |
}, | |
}); | |
var MyModel = mongoose.model("MyModel", schema); |
Taken from Naming Tips.
-
Do not name methods
ProcessData()
. You only get to use this method name once per career, because you should have been fired immediately afterwards. Be specific about what it's doing inside; call itValidateUserCredentials
orEliminateDuplicateRequests
orComputeAverageAge
, etc. -
Use naming to help you design the program. Pretend there's a rule saying "you can never write a
void
function", then think about all the steps your program makes to transform input into output, then chose names for those steps so you could make a written sentence with them. These are now your function names and the sentence is your program's structure.
OlderNewer