How to write own scaffolder (like RoR has?) [closed] - javascript

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I would like to create own scaffolder for websites, something like Ruby On Rails has:
rails g modelname fieldlist
But for my own purposes - it should generate HTML, CSS and JavaScript files in proper folders (folder paths will be taken from configuration file) with specific content.
My question is: which language (or tool) is the best for such task?
I was trying to write that using bash but codebase became quick very large and messy.
My target is unix platforms (especially Linux) - I'm thinking about Ruby or Python, but can I achieve such task with e.g. JavaScript/node?
Are there tools for something like that? I've heard something about Yeoman but I'm not sure if it is capable for my problem here.

Well since your question is too broad and you seem to be looking for a website generator, at least for Ruby here are the most obvious choices:
https://www.ruby-toolbox.com/categories/static_website_generation
All of them use templates, which I assume that will be usefull.
One of the most popular choice is the jekyll, which powers github pages
If none of them work for you, you can investigate their source code to create your own solution.
If you are going the rails way there's rails apps composer

Related

questions about php and node.js with answers [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I'm working with PHP and I love this language but when I look at big websites there a small percentage of them using PHP and the rest of using node.js etc, so based on the big websites like Netflix, etc, have some questions
1- Is PHP required in companies?
2- what PHP framework should I learn
3- what frontend framework, etc, good for PHP?
4- is node.js better than PHP
if there is anything wrong or you can correct me I'm here to learn :)
I'm very lost I really need the answer I don't know where to go.
in PHP there is no way to automatically refresh the page however
there is a guide on this page to do that
if you started to use a framework like Laravel you can do that with
the Browsersync plugin
I have seen a lot of PHP and Laravel projects requests in freelancing
websites than node js so yes it's required
both languages are needed there is no language better than the other
one each one have its use cases

javascript/Jquery code organisation [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm creating a php app where almost all requests are in ajax and some Jquery effects, so some of my pages are up to 2000 lines of code, all my jquery in one big $document.ready{}, is it normal? should I be ashamed of showing this code to other developers? or is there a better way of organasing Jquery code ?
Like how many others have said, if it's maintainable and easy to read then it shouldn't be much of an issue. However, in my experiences, code that is organized into separate logical modules were MUCH easier to read and maintain than one long document.
With that being said, the typical workflow these days with tools such as browserify would be to refactor and separate the code such that each file executes a specific task for development purposes and when it is time to deploy to production, one would use a build tool to group/minify and optimize for the browser.

What program does apple uses to create modular javascript files [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
When I looked at the new MacBook website from Apple I saw a nice smooth scrolling effect on the wireless page. I started digging in the JavaScript and found an uncompressed JavaScript file and I was blown away. (https://www.apple.com/v/macbook/a/scripts/wireless.built.js)
There were so many comments, and you could almost follow what they were thinking when they created this script. I tried to create a JavaScript file like this on my own, but in less than 5 minutes I figured out that it was almost impossible to keep it nice looking and understandable. So my question is: What program does Apple use to create this kind of JavaScript files? It is not a default code editor, but a program that supports built file. There are some good ones out there, but they all have libraries you have to follow, this one is just plain JavaScript and nothing more.
There's no tool to magically make your code look nice.
Apple has a strict code style guide that requires all developers to show discipline when writing code, or their code will be rejected from entering their repo.
It's nothing special really, just proper developer discipline.

When should I save Javascript code into different files or the same file? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am a beginner of Javascript. I have done some Python and Java before.
I am not clear when and why we should store codes into different .js files or the same file.
Is there any conventions and rules for this?
Well, the main reason of javascript code into different folders is for organization.
Similar to Java or Python, or any language, you should organize your code in different files to get a code that any other in your team can read easily.
But in production scope, or better said, in your website, it's a best practice to reduce the number os javascript files for performance reasons. If you have 2 javascript files, the server will send 2 request. In the case that you have 10 or 15 files, the web will have performance problems.
So, in development it's important to have multiple files to organice your code, but in production you can minify then into one. Uglify is a good tool to monify your code into one file.
Hope it helps.

The better way to maintain css, js, font-cion, image's versions? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have few css files for a site and some css properties are shared through all of them. Plus there are also few js files. font icons file and images that I constantly updating. Whenever I tried to push to main repository, i had to make sure each file version are bumped using "?=number". I am seriously tired of doing this.
Is there a better way to do URL version bumps all together? Any help would be appreciated.
Additional info: I am using IIS7/8 and developing in windows system by using HG Mercurial. Back end uses asp.net visual basic, mysql.
Since you're using ASP.NET, your .NET devs can set a variable that holds a common increment number that you can use as the number in the ?v=number part. So, you just change all of your CSS/JS files to consume the variable one time only. For example:
string version = ConfigurationManager.AppSettings["VersionNumber"];
If you're using bundling, there is a better answer here:
How to make bundles unminify and list individual files when using a cookieless static content server?

Categories

Resources