Instance | Branch |
---|
While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.
Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.
lib/
is intended for code that can run as-issrc/
is intended for code that needs to be manipulated before it can be used
update
I've created a little repository that simply exposes the final utility as npm
module.
It's called html-escaper
there is basically one rule only: do not ever replace one char after another if you are transforming a string into another.
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
If you're not familiar: What is fail2ban? fail2ban is an awesome linux service/monitor that scans log files (e.g. auth.log for SSH) for potentially malicious behavior. Once fail2ban is tripped it will ban users for a specified duration by adding rules to Iptables. If you're unfamiliar with fail2ban Chris Fidao has a wonderful (& free!) series about security including setting up fail2ban here.
Recently Laravel released a new feature in 5.1 to throttle authentication attempts by simply adding a trait to your authentication controller. The Laravel throttle trait uses the inputted username, and IP address to throttle attempts. I love seeing this added to a framework out of the box, but what about some of our other apps not built on Laravel? Like a WordPress login? Or even an open API etc.? Ultimately,
<?php | |
$finder = Symfony\Component\Finder\Finder::create() | |
->notPath('bootstrap/cache') | |
->notPath('storage') | |
->notPath('vendor') | |
->in(__DIR__) | |
->name('*.php') | |
->notName('*.blade.php') | |
->ignoreDotFiles(true) |
(function() { | |
var errorBoxElement = false; | |
var showError = function(error) { | |
if (!errorBoxElement) { | |
errorBoxElement = document.createElement('div'); | |
errorBoxElement.style.position = 'absolute'; | |
errorBoxElement.style.top = '0'; | |
errorBoxElement.style.bottom = '0'; | |
errorBoxElement.style.left = '0'; | |
errorBoxElement.style.right = '0'; |
<?php | |
namespace AppBundle\Cache; | |
use JMS\DiExtraBundle\Annotation as DI; | |
use Symfony\Component\HttpFoundation\RequestStack; | |
use Doctrine\Common\Cache\CacheProvider; | |
use AppBundle\Model\SomethingGeneratorInterface; | |
/** |
// ... | |
let webpack = require("webpack"); | |
mix.webpackConfig({ | |
plugins: [ | |
// Choose the language you want to keep (Ex: "fr") | |
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /fr/) | |
] | |
}); |