Is there anyway to modify the folders nesting levels in patternlab.io - handlebars.js

I am working on patternlab.io project and by default it allows only two levels folder nesting under "./source/_patterns/.".
It's strongly suggested to not deviate from the following structure under _patterns/
[patternGroup]/[patternSubgroup]/[patternName].[patternExtension]
but I have to use the following
[patternGroup]/[patternSubgroup]/[patternSubgroup]/[patternSubgroup]/[patternName].[patternExtension]
Is there anyway to modify the folders nesting?

Related

Is there a place to put rules in Tailwind V1 where they will escape the purge?

I want some extra classes to deal with dynamically generated class names. I don't need to generate these classes, I can manually add them, but I want to make sure they aren't pruned out. I know V2+ can whitelist classes that aren't used within the same project but I am stuck with v1 for a while (work stuff!) so I was wondering if there was a place to put rules that would be safe from the pruning V1s pruning mechanism.
I suppose I can list these classes somewhere in the purge path if I have to but I'd rather avoid that if poss.

Julia: packaging things into modules vs include()-ing them

I'm building a simulation in Julia and I have my code split across a bunch of files. Are there any benefits to wrapping everything in modules versus simplying include()-ing them in the runscript?
I have something like the following at the top of my runscript right now:
for filename in split(readall(`git ls-files`))
#everywhere include(filename)
end
I'm not planning to use the code outside of this immediate project, but I am running the simulation in parallel. Is there any benefit in creating modules?
I would say that the most important benefit is modularity :)
If you have different files that deal with different things, splitting the code into modules let's you keep track on the dependencies between the modules:
Which functions are purely implementation details of the given module and subject to change?
Which modules depend on which other modules?
It also lets you reuse the same name for different things in the different modules if you need to, if you're a little careful of what you export. (You can still access those names from the outside as qualified names)
For an example of such organisation, you can look at my repo https://github.com/toivoh/Debug.jl

Where to put common Functions/Constants in ASP.Net MVC

I am new to ASP.Net MVC. I have a couple of controllers and models. They all use a set of static functions and constants which I call common code.
In my MVC project I have folders for Controller, models and view etc,
Where is all the common code supposed to be put ?
Is is OK to create a Common folder and create new class for my static functions and same for global constants ?
If you reuse this common code often across solutions, you might want to consider compiling it into its own class library and simply referencing the assembly.
Another thing you'll want to consider is the nature of the common functions. Are they truly just helper functions (like manipulating strings and stuff like that) or do they make more sense mixed into your business layers?
Basic rule is to keep it organized be consistent. There's no right or wrong way to structure your application...only hundreds of thousands of opinions.
Exactly you can create Helper folder when you set your extension methods or another common utility.
But for constants suggest you to create Ressource File
Remarks : All text , warning or info messages, put theses elements in ressource and don't write in code, for gloabalization need(It's my case on project)

Compiling multiple LESS files with different variable values

I'm currently creating a site that has multiple color themes - it seemed natural to use LESS and #variables for this (using Wordpress / WP-Less). I soon realized I couldn't find a really clean way have only one, monolithical stylesheet, as, of course, after compiling variables can't be overwritten, and it's unfeasible to compile on every page render.
Creating separate theme stylesheets (which only contain the variable-modified values) seems to be the only way to go, but it will be somewhat cumbersome to maintain in the future.
I'm utilizing only 1-3 variables, but they are referenced many times.
Is it possible to utilize WP-Less/Lessphp to render multiple .css from one .less with several different variables changed?
Or is there a simpler / other standard way to achieve the above?
Less offers a way to modify variables at run-time:
Here's an excerpt from the docs online - http://lesscss.org/:
Modify variables
modifyVars enables modification of LESS variables in run-time. When called with new values, the LESS file is recompiled without reloading. Simple basic usage:
less.modifyVars({
'#buttonFace': '#5B83AD',
'#buttonText': '#D9EEF2'
});

cmake best practice

When working with cmake, is it better to work with one large CMakeLists.txt in the root of the project, or as seems to be seen in some places, having one in each subdirectory too?
I would assume something along the lines of for large projects, having one in each directory is better.
If so, where should the threshold be?
I would certainly go for using multiple CMakeListst.txt files.
As a rule of thumb I think you should go for one CMakeLists.txt (and thus subdirectory) per target. So, each library or executable has its own CMakeLists.txt.
You can then create one "master" CMakeLists.txt that includes all the others using the add_subdirectory call. If you take care that you order these statements correctly, you can easily reference previously defined targets in the other CMakeLists.txt file.

Resources