Pixi.js vs Pixi.min.js differences? - pixi.js

I'm new to web development and currently learning Pixi.js and I noticed there are few versions:
Pixi.js
Pixi.js.map
Pixi.min.js
Pixi.min.js.map
May I know is there any differences between these in terms of features?

they're not at all different version, it's just a common convention in javascript programming: "min.js" files are the "minified" lib source, that's mean the same ".js" file where spaces, end of line and other unnecessary (for the browser) characters are cut off, and also variables names were changed with shorter ones, to obtain a lighter source file, less heavy to download and easier to execute for the browser. This file is obviously automatically generated from tools like gulp and grunt and is the source file you have to upload to the server and finally serve to the user. ".map" files instead are, whell, maps who link minified files to their full size counterpart, whit just min and map files, chrome debugger can reconstruct the original source and show it to you in the inspector.

To answer your question: No they are exactly the same, when it comes to features.
A *.min.js file is just the original.js file but "minified".
That means names were shortened (e.g function getName changed to n).
It's size (bytes) is also reduced.

Related

How to watch changes to compiled CSS and update original SCSS?

I know it sounds ridiculous, but Chrome writes to the compiled CSS when using the Developer Tools -> Elements -> Styles with workspace set up. It sees the original partial, but when changing a property, it writes to the compiled (they say it's working as intended, lol). Therefore I would like to:
Watch or intercept 3rd party writes to compiled (changes that didn't occur from the compile due to regular --watch).
Map the change using the sourcemap to the original SCSS file.
Save the changed SCSS file.
That will trigger a new compile. The compiled CSS will probably be the same as how Chrome left it. But this time the values arrive from SCSS and will persist.
I know that if I change stuff on the Sources tab, it does save to the right file. But I don't get a live preview then playing directly with the SCSS file on the Sources tab, only if I save. My workflow includes changing the design live on the Elements -> Style tab, then (for now) copy pasting the values I like to the file. If I have to switch to the Sources tab and I see the unchanged original values there (paste the changes, save, refresh), I might as well just switch to VS Code to do the same thing, it defeats the purpose of how it should work (when no SCSS is thrown into the mix).
I'm using sass from npm but I see this reverse sync would be the task of a custom script that can somehow distinguish the process that wrote to the file to avoid an infinite loop. The files are local but in an Ubuntu VM that has a samba share so they are accessed via a drive letter in Windows (Chrome is told that path). The solution just has to work, I don't care what language or platform.

How can I minify html, css, js/jquery and ruby code inside Sublime Text 3?

Running Windows 7. What is the best Sublime Text 3 plugin to do this, and maybe beautify the code as well.
May be useful, this shortcut will erase all line breaks of the selected text
Ctrl + J
Notice this is not really minify, since it doesn't consider the code language.
You may have already found something you like by now, but I just ran across this same need and have tried out two plugins: Minifier and Clientside. Clientside has more features like linting and beautifying but is only compatible up to ST2 (according to its Package Control page), whereas Minifier should be compatible with ST3.
Updated 8. 4. 2015 as many things have changed
I've been looking for such ST3 plugin as well. I've tried Sublime HTML5 Minifier by geekpradd and Minify by Zoltan, both seem as great options. See their pros and cons.
HTML5 Minifier
Only minifies, cannot beautify (so far)
Doesn't restructure your CSS or JavaScript files, only removes white space and comments
Not as effective as Minify, but keeps the code readable after beautification
Works for HTML, CSS and JS without trouble
Can minify the code in the current view without creating new files or saving anything
Easy installation, doesn't require Node.js or anything else
Has a typo in console - HTML Minfier instead of HTML Minifier. But maybe it's on purpose :)
Minify
Minifies and beautifies
Restructure your CSS and JavaScript files, renames JS variables, function names etc.
Super effective, smallest file sizes possible, but the code is changed by the minification process
Works for HTML, CSS and JS without trouble, also should support SVG (haven't tested)
Can't minify the code in the current view without creating new files or saving anything, minification always creates a new .min. or .beatified. file in the same directory
A bit more complicated installation, requires Node.js and some other Node.js CLI apps
Which plugin is better?
There is no straightforward answer for that. Minify is more effective, so as long as all you care about is the smallest file size possible, Minify is your choice. I personally use both of these as in some cases, HTML5 Minifier may be a better choice in some cases.
I'm just hoping that Zoltan, the Minify developer, will add the crucial functionality to minify the current buffer without creating or saving any file just like geekpradd did.
I know it is an old question, but here is my answer anyway:
I recommend you to visit the excellent Package Control website and perform a search for the keyword "minify"
You will get a list of various packages for the Sublime Text editor which provide the requested functionality (minifying / beautifying).
Disclosure: I am the author of one of the packages listed on the Package Control website: Minify.
I am not saying that my package is best for everyone, but Minify is the package I use, obviously.
Note: I'm also on Windows 7. My Minify package works in both Sublime Text 2 and Sublime Text 3. Once installed, it works offline, so you can even minify your files while you are not connected to the Internet.

How can I specify the version of zip to use in bash?

Background (not necessary to read)
I'm tinkering with MS office files for work (trying to figure out the quickest, easiest way to automate generation of arbitrary-length excel and powerpoint files). Since actual excel files are just zipped archives with .xlsx appended to the filename, I've been unzipping them, editing the xml, rezipping them, and seeing whether OpenOffice can still load them.
However, I've realized (after not too much such testing, thankfully) that, by default, the 'zip' command in bash (or, at least, on my mac) is zipping the files in a format that only requires unzip v1.0 to extract, but normal excel files are zipped in such a way that they require v2.0 to extract. I checked this is a problem by zipping and unzipping an excel file that I knew loaded normally, and then trying to load it. OpenOffice was displeased.
So, I know I need to make the file zip exactly the way excel does, but how to make that happen I'm not sure. I have zip version 3 on my computer, so hopefully if the zip/unzip release cycles are synchronized it should be possible, but I didn't see anything on the man page that immediately seemed to be the solution.
edit:
And zip -9 (which zip -h helpfully says instructs zip to 'zip better') still only requires v1.0 to extract.
Question:
How can I specify in bash that I want zip to zip a file in such a way that it would require unzip v2.0 to unzip?
Often, the reason for an incompatibility between compressed files produced by different versions is the compression algorithm used. If the files were compressed with an algorithm that didn't exist in zip 1.0, that would cause the incompatibility you're seeing.
Look at the man page for your zip utility, see if there's an option to specify the type of compression to use. If there is, look at the existing files created from Excel, and find out what type of compression algorithm they're compressed with, and use that.
On my Linux system, zip reports "This is Zip 2.31 (March 8th 2005), by Info-ZIP.", and it does not have an option for specifying the compression algorithm. On my Windows system, 7-zip does have the option, and it looks like they do have a Mac version available, so you could try that if your zip utility doesn't support that option.

How to prepare a Linux app to find ttf font directory?

I'm working on an application primary targeted for Linux, which use a TTF font. I need the font's file name and path, because I have to load it with SDL function TTF_OpenFont(char *file, ...). The problem is that there are a lot of different directories for TTF fonts on different distribution. Which is the best way to deal with this problem? I've came up some solutution, but each of them seems suboptimal for me:
pack the font along with the application, and install it to the application's own /usr/share/ directory.
check the font path with fc-list : file.
hardcode every path variation to the application and try them out when load the file.
Your first and second solutions are quite good, except it may be better to call FcFontList function. Third one is quite unreliable, but it highly depends on application type (it can be ok in some cases, if you have this path configurable by user).

make swf from fla without ever opening it

is it possible to change text and images in a fla file without ever opening it up and then making the swf via command line? I want to make a flash template and save the fla. Then be able to update my text and image name and convert it to swf. I have one template but tons of different text options and background images. It would be nice to be able to copy the master.fla twenty times and just change the source code (will do this from command line) and then convert to swf (via command line).
Any help would be appreciated.
With CS5, you can do half of what you're asking today, by using the XFL file format instead of FLA. Instead of a binary blob, you get an editable XML file and a tree of separate asset files: PNGs, AS3 files, etc. You can then modify the XML or AS3 files programmatically to get your variants.
(A CS5 FLA file is really just a zipped up version of the XFL, but there's no advantage to using that instead of an XFL. In CS4 and previous, FLA was a proprietary binary format.)
The missing piece is an XFL compiler. Adobe currently provides no such thing, and the third party market hasn't yet produced one.
You could use a systems automation tool to drive the Flash Professional environment through the compilation steps. On OS X, for example, either Automator or AppleScript should be able to do what you want. It'll just have more overhead than the command line compiler you were hoping for.
I agree with Jason, there are a lot of alternatives to what you suggest. Keeping content out of the SWF is good practice actually. This is a good way to avoid large files!
Depending on what you 're looking to achieve, there are a lot of solutions available. XML is an option, JSON another.
If you're looking to build a template, any of the above would seem appropriate.
It sounds like you're working from the Flash IDE, as Jason suggests you may want to have a look at another IDE, such as FlashDevelop, FDT or FlashBuilder as they make coding with AS3 a lot easier.

Resources