-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
| ;(function($) { | |
| $.stacheComb = function(el, name, context, options) { | |
| var defaults = { | |
| container: 'body', | |
| path : 'templates/' | |
| }; | |
| var plugin = this; |
| /** | |
| * Copyright 2012 Akseli Palén. | |
| * Created 2012-07-15. | |
| * Licensed under the MIT license. | |
| * | |
| * <license> | |
| * 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, |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |
(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.
| //oauth2 auth | |
| chrome.identity.getAuthToken( | |
| {'interactive': true}, | |
| function(){ | |
| //load Google's javascript client libraries | |
| window.gapi_onload = authorize; | |
| loadScript('https://apis.google.com/js/client.js'); | |
| } | |
| ); |
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.