Just some notes and references for myself.
- In bash, you can access your
C:\drive via/mnt/c/ ~=C:\Users\MLM\AppData\Local\lxss\home\mlmand is different from your Windows user directoryC:\Users\MLM
| //events - a super-basic Javascript (publish subscribe) pattern | |
| var events = { | |
| events: {}, | |
| on: function (eventName, fn) { | |
| this.events[eventName] = this.events[eventName] || []; | |
| this.events[eventName].push(fn); | |
| }, | |
| off: function(eventName, fn) { | |
| if (this.events[eventName]) { |
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
| // The hacky bit of this approach is that this module uses | |
| // jQuery, but it is not referenced here. This is because I | |
| // am populating it in the test via global namespace. | |
| // | |
| // In the browser this still works because I am adding jQuery | |
| // via a Browserify transform (browserify-global-shim). | |
| function someModule() { | |
| } | |
| modules.export = someModule; |
| require 'json' | |
| require 'yaml' | |
| input_filename = ARGV[0] | |
| output_filename = input_filename.sub(/(yml|yaml)$/, 'json') | |
| input_file = File.open(input_filename, 'r') | |
| input_yml = input_file.read | |
| input_file.close |
| /* ******************************************************************************************* | |
| * THE UPDATED VERSION IS AVAILABLE AT | |
| * https://github.com/LeCoupa/awesome-cheatsheets | |
| * ******************************************************************************************* */ | |
| // 0. Synopsis. | |
| // http://nodejs.org/api/synopsis.html |
| // for detailed comments and demo, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381 | |
| /* a helper to execute an IF statement with any expression | |
| USAGE: | |
| -- Yes you NEED to properly escape the string literals, or just alternate single and double quotes | |
| -- to access any global function or property you should use window.functionName() instead of just functionName() | |
| -- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later | |
| <p> | |
| {{#xif " name == 'Sam' && age === '12' " }} | |
| BOOM |
| <?php | |
| /** | |
| * DataContainer for shortcodes. | |
| * | |
| * @author Bart Stroeken | |
| */ | |
| class ShortcodeReference { | |
| /** | |
| * Shortcode |