Skip directly to content

Feed-aggregator

How to Speed Up Website with <LINK> Tag

hongkiat.com - 2 uur 53 min geleden

"Foreseeing" browsers are the future of top speed Internet surfing, bringing us resources we want even before we know we want them. Today’s browsers already make some predictions now and then to speed up fetching and rendering of documents. To take this to the next step, we look to none other than web developers.

Developers have a pretty good idea of how their websites are navigated, and which resources are requested most often and thus, they can predict some future operations browsers should do for sites. All that’s needed now is for developers to find a way to relay these predictions to browsers and put them to good use. This is where some special "HTML links" come in.

A Refresher on HTTP Requests

Before taking a look at these links, it’s time to refresh our memory on how a typical HTTP-requested file-fetching operation happens. Let’s say someone named Joe wants to visit a website.

Here’s what happens next:

  1. Joe types the website’s humanly recallable address in a browser’s address bar and presses "Enter".
  2. Once it received that address, the browser asks a DNS server (compliments of ISP) for the IP address of the address given by Joe.
  3. The DNS server obliges.
  4. Now that the browser knows the IP address, it sends a message (in TCP dialect) to the website’s server, asking for a connection.
  5. If the server is alive and well, it sends a reply acknowledging the browser’s request and the browser responds and acknowledges the server’s message. (Note: Yes, this is an extremely watered down version of a TCP handshake between a client and a server.)
  6. When the handshakes are over, a connection is established between the two.
  7. Now, browser changes its dialect style to HTTP and asks the server for the website.
  8. The server, knowing the home page of the website returns just that, which is received by the browser and shown to Joe who’s waiting very patiently in front of the computer.

A typical HTTP request goes through all that (and more) to fetch a document through the Internet. So if any of these process can be jumpstarted when possible, we can reduce the time we have to wait for the delivery of the resources we want.

HTML Link Relationships

W3C specifies 4 HTML link relationships (rel for relationship) named dns-prefetch, preconnect, prefetch, and prerender. Together they are called (by W3C) the "Resource Hints". Now, we’ll see what they can do and where they can be used.

1. DNS Prefetch

In DNS prefetch, the domain name resolution (aka getting the matching IP address from DNS server) is done ahead of time.

Let’s say there’s a reference page in a website with lots of reference links to its sister site. When a user visits the reference page, there’s a high probability that the user will navigate to the sister site. So, an early DNS lookup for the sister site can reduce the time it takes to open the site (thereby improving user experience).

This latency reduction via DNS prefetching can be done by adding this code to the reference page.

<link rel="dns-prefetch" href="//mysistersite.org">

When a browser processes this code in the reference page, it’ll add the DNS lookup of the sister site to its task queues, and when it is free from other high-priority tasks in the queue, it will start the DNS resolution of the sister site.

So when a user finally clicks one of the links that takes them to the sister site, the DNS resolution of that site might have already been completed, and the browser can right away start establishing the client-server TCP connection with the sister site server, making that page load faster.

This feature is available in almost all modern browsers except Safari as of March 2016.

2. Preconnect

Preconnect is a step further from DNS prefetch, it establishes a connection to the server to which there may be a request sent later in the future.

W3C lists an ideal use case for preconnect: redirects. Developers use redirects for a number of reasons.

In this case, a browser’s next request (redirected site) is 100% predictable, and can be preconnected to, to reduce navigation latency.

Imagine there’s an intermediary site page that redirects to "xyzsite", the following HTML link will make the browser preconnect with the xyzsite server, when it gets to that intermediary page.

<link rel="preconnect" href="//xyzsite.com">

As of March 2016, this is available in Chrome, Opera and Firefox.

3. Prefetch

With prefetch, for a resource, the browser starts implementing the DNS resolution of the resource’s domain name, then performs a TCP connection with the resource’s server, makes the HTTP request, and finally fetches and stores the prefetched resource in the browser cache.

If you are sure of which resources that will be needed later, that’s the resource to prefetch beforehand; therein lies the catch. Prefetching takes guesswork, and if you guess wrongly, you might actually slow down instead of speed up your site.

For online books, galleries, or portfolios, if the user is most likely to browse to the next page, prefetching the resources such as images, can speed things up significantly. Here’s the code to do that.

<link rel="prefetch" href="//xyzsite.com/nextimage.jpg">

Prefetch is supported in Chrome, Firefox and Opera.

4. Prerender

Only for HTML pages can prerendering be done. A prerendered HTML page is rendered offline, and is painted to the screen when it’s actually needed by the user. Rendering costs a higher computational work and memory resource; plus, in order to render a page, the browser may need extra resources (like images added to the page) which will lead to more consequent requests by browser.

So, prerender has to be used with caution, and not overused. Adding the following code will prerender the "About" page beforehand.

<link rel="prerender" href="//example.com/about.html">

Prerender is already available in Chrome, IE and Opera as of March 2016.

A few Things to Note

(1) None of the abovementioned resource hints guarantee the execution and completion of the different stages of request it’s made for because when the browser is already busy processing the requests needed for the operations of the current page the user is in, performing these optimizations can hinder user’s current tasks.

So, everything is queued and executed when the browser feels free enough to do so.

These resource hints do not necessarily have to be present in the page even before the loading of the page. They can be added later by JavaScript, and the resource hints will do their job as usual.

(2) W3C specifies a HTML link attribute called hint probability, pr (with value 0 to 1) for these resource hints, which can be used to provide the probability of requests that will be made in the future. I haven’t seen this attribute being implemented by any browser yet though. As an example, the following code states that there’s an 80% chance xyzsite will be requested in the future and 30% for the about page.

<link rel="preconnect" href="//xyzsite.com" pr="0.8"> <link rel="prerender" href="//example.com/about.html" pr="0.3">

We can also add the optional crossorigin attribute to the resource hints to inform the browser of the linked request’s CORS credential.

If “Game of Thrones” Characters Were Your Design Clients

hongkiat.com - do, 28/04/2016 - 17:01

Clients are the only reason a design business can exist. One has to be either very lucky or very astute in order to be working for just the perfect set of clients. However, in real life, most designers and design firms are faced with a varied clientele, and each one of them has distinct requirements and styles of working.

A simple classification can be ‘good clients’ and ‘bad clients’. But there are certain types of clients who fall under a rather interesting third type of category i.e. the Game of Thrones types. These are the clients, whom in their conduct, have a striking resemblance to certain characters of Game of Thrones television show.

I have enjoyed GoT quite intently since it first started. While watching the show, apart from its awesome locations, costumes and breathtaking twists, I often envisage some of its main characters as dramatic personifications of certain clients that my designer friends deal with every day. And it’s not as strange as it sounds…

Daenerys Targaryen Impatient & Impulsive

Daenerys Targaryen is one of the most central characters in the show and her daunting personality is marked by impatience and impulsiveness.

Similar to this, there are clients who are totally devoid of the virtue of patience in terms of getting their work done. Such ‘Targaryen clients’ are quick at making decisions with a greater tendency to reject the artwork in an impulse. Their concept of deadlines is same as their temper i.e. very short and everything has to be done yesterday.

However, like Daenerys’ dragons, they are attractive with regards to payment, in which they always try to do justice with you.

Tyrion Lannister Calm and Wise

One of the most interesting characters in the show, Tyrion Lannister has been composed and sensible in every position he has found himself in (with one exception, though).

Likewise, the clients under this category are the ones who basically concern themselves with their own brand’s communication, indifferent from what others are doing in the field. With proper rationales, you can convince such clients on the designs you present, and can also be reasoned with in the matter of deadlines.

However, clients like these maybe very good with words and in the way of you convincing them, they can in turn easily win you over with sane arguments. Also, like Tyrion Lannister, such clients are not habitual of delayed payments.

Sansa Stark The Downtrodden

Sansa is the eldest Stark girl who has been under the cloud of multiple tragedies since the commencement of the show.

There are certain types of clients a designer faces who are similar to Sansa in a way that they have already fallen in non-professional hands of many designers or design firms before coming to you for work.

You could easily see the flaws in the designs that their previous designers produced which cost them the image of their brand. Owing to their previous experiences, such clients are reluctant and skeptical towards unconventional concepts and often like to stay ‘on the safer side’.

Arya Stark Hot-Headed Vigilante

Youngest of the Stark girls, Arya Stark is characterized by being hot-headed and vigilant towards her surroundings.

The clients who fall in this category are the ones who are highly concerned with the survival and up-keeping of their brand and hold a strict eye on what their competitors are doing.

You can expect them to even bring you communication designs of their rivals and ask you to make their own designs so different and awesome that they "destroy the competitors". Moreover, such clients are pretty adventurous too and, if it adds life to their brand, they will go with any concept, no matter how bold it may be.

Stannis Baratheon Blind Follower

Highly influenced by his attractive magician consultant, Stannis Baratheon follows any suggestion that takes him closer to the great throne.

The highly influenced Baratheon often reminds me of clients who are too dependent on their communications manager. Even if you try to reach out to them directly, they will ask you to contact their manager eventually.

In a case like this, the communications manager is a menace in itself and would likely do anything to make sure you have no direct contact with the real client. Furthermore, clients like these have a tendency to make you work long hours for their campaign and in return of your hard work they are often short of money to pay you.

Jon Snow Knows Nothing

Jon Snow is yet another central character of the show who lives in the farthest corner of the realm and has no idea about his origins or about the things going on in the real world.

Like Jon Snow, the clients who fall in this type have no idea as how to get their communication designed. They are ignorant about the latest design trends or what their contemporaries are doing.

When you show them the artwork their reactions are mostly indecisive and confused and so they ask for changes after changes. They would brief one thing in the meeting and suggest a totally opposite thing in an email next day. When it comes to payment you send your invoice to their finance department and later when you ask, they will have not much idea about that either.

Conclusion

A designer’s clientele comes from a variety of backgrounds based on their qualification, type of industry they represent, style of working, and in case of online designers, from different countries and cultural backgrounds.

Alongside their goodness, some of your clients may have over-lapping characteristics from each of these different types mentioned above.

On a lighter note, I would suggest that with a bunch of conventionally good clients, a designer should keep a couple of difficult ones as well, just to challenge themselves and practice patience every now and then.

On a serious note though, a diverse clientele is important for your line of work, it keeps your mind fresh, and in my views, is the real essence of a successful design business.

Editor’s note: All images used in this article are from the Game of Thrones wiki page.

Quantum Computing Explained (Like You Are A 5-Year-Old)

hongkiat.com - do, 28/04/2016 - 15:01

The concept of "Quantum Computing" recently going viral – thanks to a certain Prime Minister – is one of the many uncharted territories of science by us non-scientific peeps.

The reason most of us haven’t heard of it yet in spite of it being around for decades, is that for the most part it’s theoretical and those who were experimenting on it at the beginning were very hush-hush about it due to the need for military and corporate secrecy.

Nonetheless, we now know that a quantum mechanics and computing combination exists and suddenly this is inside everybody’s scope of interest. If you don’t know what a quantum computer but don’t want to be left out of the loop, read on to find out why it is better than the traditional computers we work with today.

Of Traditional Computers and Bits

Computers are mostly digital-electronic and will interact with data represented in binary digits known as bits (0’s and 1’s). Be it images, text, audio or any other data – it’s all stored in bits.

Physically, the binary numbers 0 and 1 can be represented using any two-state entity like a coin (head and tail) or a switch (on or off). In computers, bits are the presence or absence of voltage (1 or 0), or change or preservation of magnetic direction in magnetic hard disks.

Data is manipulated by computing the stored bits. Computation is done by logic gates which are typically made up of transistors that control the passage of electronic signal. If it allows the signal to pass through, it’s the bit 1 and if the signal is cut off, it’s 0.

The Limits of Transistors

With the ever-shrinking chip size and growing number of components, electronic devices can come with millions of transistors that can be as small as 7nm (which is 1000 times smaller than a red blood cell and only 20 times larger than some atoms).

The size of transistors can continue to shrink but eventually, they’ll hit a physical limit where electrons will just tunnel through them and there’ll be no control over the electronic signal flow.

For the ever growing need of powerful computation and smaller devices, a size limit on a basic electronic component is a progress curb. Scientists are looking for new ways that take less time and space to compute and store data, and one of the ways we can use is quantum computing.

Qubits, Superposition and Entanglement

Quantum computing uses qubits instead of bits to represent data. Qubits are represented using quantum particles like electrons and photons.

IMAGE: universe-review.ca

Quantum particles possess properties like spin and polarization which can be used to represent data. For example, a qubit spinning upward can be 1 and downward 0.

But the power of quantum computing comes from the fact that unlike bits which are either 1 or 0, qubits can be 1 and 0 simultaneously, because of a property called superposition, where quantum particles are in multiple states at the same time.

This increases the computation power of qubit, since it can be used for both 1 and 0 during computation and at the end, once measured, it becomes either 1 or 0.

The superposition property can be easily explained by a famous thought experiment done on an imaginary cat by Schrödinger, an Austrian physicist.

In the quantum world, there is also another property that can be exploited in computing quantum entanglement. It basically refers to quantum particles’ properties that get entangled and become dependent on each other and thus cannot be changed separately.

They act like a single system with an overall state.

Let’s say 2 qubits undergo entanglement, if one of the qubit’s state is changed, the other will change too. This leads to real parallel processing or computing that can cut the computing time significantly compared to traditional computers.

Difficulties and Uses

There are many practical hurdles to be overcome by the scientists and engineers, like creating a controlled environment for the qubits and finding ways to manipulate their properties, to produce a desired outcome.

But once quantum computers with high computational power are finally created, they can be used to solve problems that would otherwise take a very long time to be completed by traditional computers.

Finding prime factors of large numbers, the traveling salesman problem for a large number of cities, and other similar problems require an exponential number of comparisons to get results. Also, searching through colossal databases is still a very time-consuming process for even current digital computers.

These issues can be addressed with quantum computers, which can solve problems that can take centuries in traditional computers, in a matter of minutes.

(H/T: IBM)

Why You Need Code Sniffers for Web Development

hongkiat.com - wo, 27/04/2016 - 17:01

Code optimization is comparable to the editing phase of a writing. You may first need to get your ideas down in code, but your code should be optimized with tools like code sniffers to produce the best possible product.

Code sniffing is a term that describes checking code for compliance with regulatory standards. These regulations might specify the number of spaces to use for indentation, the placement of curly braces, or how to name variables. Standards aren’t vital to build a web application, but standards are important for internal consistency and code maintenance.

This is where code sniffing comes in handy for all developers, frontend to backend. I’d like to examine the process of code sniffing and offer some utilities that help analyze code standards.

What Is Code Sniffing?

The action of code sniffing is typically automated to save time and reduce errors. Code sniffers will check source codes for compliance with standards set by internal development teams or regulatory bodies.

Code sniffing is similar to code linting but more pedantic. Linting primarily checks for bugs and syntax errors while sniffing looks for issues in the way code is written. A PHP file can still function properly but will fail a code sniffing test if a variable name doesn’t follow standards (ie. $myVariable vs $my_variable).

A similar piece of terminology is code smell which checks for design flaws in the code that may lead to larger bugs. This can relate to code standards but also includes higher-level architectures for writing homogeneous code.

All of these areas are worth covering and are relevant to code sniffing. Just keep in mind that sniffing code won’t always find runtime bugs since its priority is maintaining strict compliance with standards.

By now you might be asking yourself do standards even matter? The truth is they do matter, but more for optimization and project clean-up. Many developers agree that standards are vital to programming and web development – especially on large team projects.

Here’s a quote from developer Paul Jones explaining why code standards are useful.

“The point of a coding style standard is not to say one style is objectively better than another… Instead the point is to set up known expectations on how code is going to look.”

If you’re building a small webapp for yourself it may not be worth spending time on WCAG 2.0 or PSR-2 standards. But consider the hundreds of developers working on Adobe Photoshop’s source code. It would be chaotic if each person wrote their own style and combined it all together.

Although teams rely heavily on standards, these rules can still be useful to lone developers as well. You can find code standards for everything from CSS to WordPress so there’s no excuse to not try and see if your code quality improves.

The Value of Code Standards

Standards will naturally keep your code clean and organized. Developers know exactly how to write code and how to follow along with each other’s work.

Code standards also help open source development by offering rules for others to follow. Files can be picked up by anyone months or years later and still be easy to read.

A strict coding style is a good idea even if you choose to make up your own. This takes a lot of effort, but as projects grow this type of documentation is invaluable.

Here are some coding standards to consider that span the gamut of various web languages.

Best Code Sniffing Resources

It’s now possible to find free code sniffers for everything from HTML/CSS to backend languages like PHP and SQL. You may not need to use these sniffers or follow standards for every language but it’s worth investigating the possibilities to see what might improve your performance.

Frontend Code Sniffers

Although HTML doesn’t need a code sniffer that didn’t stop Squiz from building one. It’s completely open source and hosted on GitHub with the options to copy/paste code into the browser or save a bookmarklet to run on individual webpages.

This sniffer checks against WCAG’s three levels of A, AA, and AAA accessibility standards along with the section 508 guidelines which apply primarily to government websites.

CSS developers might like this free CSS code sniffer which is also open source, hosted through the Node Package Manager.

jQuery users should check out JSCodeSniffer built by Dmitry Sheiko. This is another free webapp hosted on GitHub that complies with jQuery’s code style guide.

Alternatively you might want to try linting your JS code with JavaScript Lint or JS Lint. These tools check for errors in syntax rather than code standards, but they’re also very helpful when it comes to frontend code optimization.

For the record it’s also possible to check JS/CSS standards directly with PHP_CodeSniffer.

The PHP Code Sniffer

PHP_CodeSniffer is a must-have tool in your toolbelt if you’re looking to comply with PHP code standards. The package contains a few PHP scripts that analyze PHP, JS, and CSS code for compliance with your choice of code style documentation.

The creator of PHP_CodeSniffer Greg Sherwood wrote a wonderful backstory about how the idea came about and what problems it attempts to solve (well worth reading if you have the time).

In summary, Greg was working with a team learning JavaScript built into a PHP app. Their goal was to structure the JS in a way that followed PHP’s code standards to make life easier switching back and forth. Thus PHP_CodeSniffer was born.

This is great for PHP developers because the language is very loose with mandatory style requirements. Frameworks such as Laravel are more strict, but developers can (and should) setup their own code standards without relying on a 3rd party framework.

Various standards like PSR-0, PSR-1, and PSR-2 are all popular and packaged with the PHP sniffing library.

But you can find plenty of other pre-made code standards for PHP CMS’ like WordPress, Magento, and Drupal. Developers on the Drupal core even released an official code sniffer module named Coder.

PHP is undoubtedly the easiest language to optimize with code sniffers. If you’re looking for a list of PHP code standards check out this GitHub entry.

Other Backend Code Sniffers

Backend developers work with a variety of languages beyond PHP and the numbers are growing each year. With alternate languages we also have alternate code sniffing libraries like code-sniffer for Python.

It’s possible to check other scripts online or use tools like PyLint. But this is another methodology that requires patience to work into your development flow.

Ruby devs also have a series of choices when it comes to code linting and analysis. The best ones are always free and open source like Ruby Lint, a static code analyzer built for modern Ruby code.

I’ve yet to find a dedicated Node.js code sniffer but I’m hoping a project will emerge with time. There are JS code sniffers that support Node standards, but it’s still a newer backend language and requires time to grow.

Lastly we have SQL syntax used for databases. This code may be trickier since it’s difficult to find well-supported syntax standards for SQL source code. But I did find a SQL formatting webapp which should prove tremendously useful when optimizing database queries.

Wrap Up

The best place to start code sniffing is with one language and one standard. HTML/CSS is an easy place to start for frontend developers while PHP is often a favorite choice among backend developers (especially WordPress devs).

And if you want to learn more check out these related posts on code sniffing, linting, and automated code analysis for optimization.

19 Talented Artists To Follow On Facebook

hongkiat.com - wo, 27/04/2016 - 15:01

Social media is home to many designers and artists who want to make a name for themselves. We featured a few of those found on Instagram, Dribbble and Tumblr. For this round, it is the artists you can find on Facebook, and boy do we have a list. If you’re looking for your next creativity fix, this is where you shoudl be.

In this compilation, you’ll find 19 Facebook fanpages of amazing artists, who dabble with mediums ranging from digital art to traditional paintings. I hope that from this inspirational article you can find yourself the courage to start your own creative endeavors. Above all, have fun!

David Mack

David Mack is the creator of KABUKI, an amazing graphic novel that has challenged the classic format of the "typical comic”. He is now active on Facebook, where he often shares his works and his progresses. His favored medium is watercolor and ink.

ZAZAC NAMOO

Sung Ho Lee (aka ZAZAC NAMOO) is an extraordinary artist who works with a wide range of art mediums to create heavenly creations. He records the process of creation for each piece, which is bound to please any art lover.

Heather Rooney

Her illustrations are the bomb. What appear to be photographs at first glance are actually incredibly detailed artworks. Her mastery over the colored pencil medium is something to look up to, and what makes it even better is the fact that she records the progress for most illustrations.

Len-Yan

Magdalena Pągowska’s illustrations often feature handsome men with painfully beautiful melancholic features. Her colour palettes seem to be shimmering gold, with beautiful delicate touches to complete the look.

Shilin

Shilin creates beautifully detailed illustrations using digital tools. They seem like scenes out of JRPGs, or even moments taken straight out of a fantasy novel. Incredibly inspiring sights to behold.

Kyrie

An illustrator from South Korea, Kyrie creates beautiful illustrations that feature very attractive individuals. Their illustrations are so lifelike that they can be mistaken as photographs at first glance.

Alexander Jansson

Here’s a mixed media artist from Sweden, whose illustrations feature incredibly imaginative and fantastic themes. Reminiscent of a child’s dream, his artwork are so chockful with detail, it’ll be difficult not to stare at them for hours on end.

Gabriel Picolo

An illustrator based in Brazil, he gained popularity when he started doing one illustration per day – and it made it even more enjoyable to follow, as his improvements were very clear to see. Now he has a series of illustrations that feature his interpretations of Icarus and the sun, in a bittersweet love story, amongst other things.

May Ann Licudine

A mixed media artist from the Philippines, May Ann Licudine’s artwork feature delicate and beautiful young women, employing an interesting palette of colors to underline their individuality. She works with a wide range of mediums, so it’s always interesting to see what she’s up to.

Chiara Bautista

Chiara Bautista is an elusive artist. Not much is known about her or her inspirations, but she seems to have an incredibly fleshed out world where most of her illustrations take place. The slightly NSFW artworks feature a plethora of recurring character, with a loosely interwoven storyline, and each new piece seems to unlock a new part of the puzzle.

Jessica McCourt

Her artwork feature incredibly cute animals and nature themes. From the forest, to the jungle, to fantastical settings, you can find them all in her works. She also works on paper cutouts, and the amount of detail she adds to them is stunning.

Asa Ishino

She works with water colour to create lovely illustrations of adorable young women. Her style is probably what it would be like if Disney had a lovechild with Audrey Kawasaki.

Taggart Art Studio

Tom Taggart’s sculptures have a familiar, cartoony feel to them, yet they have a macabre Halloweenish vibe that’s really lovable. He also has an Etsy shop, so if any of the sculptures strike your fancy, head on over there.

Miharu Yokota

Another artist with complete mastery over the traditional medium. The girls drawn look airbrushed and created in a program, but in reality, they were made using traditional paint.

Audrey Kawasaki

Stunning illustrations featuring sleepy-eyed girls in fantastical settings. It’s hard to tell if they are all the same character but sleepy eyes definitely are the running theme of the show.

James Jean

Psychedelic works of art, with pieces vastly different from each other. Very busy and detailed illustrations, they can be best described as momentary still frames of someone’s mind.

Noferin

Incredibly cute illustrations that are bound to make anyone’s day a bit brighter. Their artwork includes sculptures as well, and they look adorable enough to squish and love to death.

Jurikoi

Digital artwork that is both incredibly stunning and badass. Combining the feel of both Japanese anime and western comics, there are many interesting illustrations to behold on Jurikoi’s Facebook page.

Cyanparade

Very beautiful anime-inspired illustrations with breathtaking colors. Her artworks often feature elements found in traditional Chinese paintings, such as flowers, cranes, and so on.

How to Create Catalog With “Request for Price” Using WooCommerce

hongkiat.com - di, 26/04/2016 - 17:01

WooCommerce offers a great way to list your products and makes it pretty easy for your customers to buy and for you to manage your orders. Sometimes, however, you may not want to actually sell your things but rather just showcase them.

In this article I’ll show you how to easily create an awesome catalog and provide a price request option by using only inherent WooCommerce options and a few pretty basic customization snippets.

Why create a Catalog?

Creating a catalog of products instead of a classic webshop can be beneficial for many reasons.

It may come in handy if you:

  • Don’t want to sell online. You’ll just need to show your catalog online and people will pop into your physical store somewhere and get busy buying.
  • May want to provide your services at a custom price for your customers or if you cannot name a price until you acquire a special component (that you don’t know the acquisition price of).
  • Cannot afford a plugin that would customize price based on the amount in the cart or by targeted shipping locations, methods and/or product sizes or some other custom values.
  • Don’t want your competitors to know your costs.
  • Don’t want to sell or showcase your products to just any buyer.
Why use WooCommerce for this?

WooCommerce comes with a lot of options out of the box, making your catalog that much easier to manage and use. By default, you can add a bunch of attributes and other data to your products, create categories and put tags on your stuff. It’s also easier to separate your catalog from your blog or site.

You can also suggest relevant wares for each product or have WooCommerce automatically suggest them for you. Furthermore, your visitors will be able to filter and/or sort your stuff as they please, to make it easier for them to find the item they are looking for.

Also, creating a WooCommerce catalog lets you provide an easy price request option for your potential customers. By allowing them to put the products into a cart, they will be able to create a wishlist and ask for the price for items in the list. You will also get their address and/or email address if you want to and your price requests will get stored as Orders.

The step-by-step guide

Before we start, you should decide whether or not you want to provide a price request option for the products you present.

Step 1: Setting (or not Setting) Prices

(I) Without price request

If you don’t want any price requests, leave the price field empty. In this case WooCommece will not show the shop-related form fields, so you won’t see any amount fields, prices or add to cart buttons.

The good news is if you choose this cataloging method, you are already finished. Just add stuff to your brand new catalog and you’re good to go!

(II) With price request

If you want to allow your customers to request price, you start out by making your products free. Set prices to 0.

This way, when we’re done, your visitors will be able to put your catalog products on a wishlist without having to spend a dime.

Step 2: Shop options

This step is going to be even easier as no code is required for it. You want to make sure to set the following in your admin area:

  • Rename your original Cart and Checkout pages to ‘Wishlist’ and ‘Request prices’, respectively
    (Pages)
  • Disallow the use of coupons to avoid discount notices on various shop-related pages
    (WooCommerce > Settings > Checkout tab)
  • Disable every payment method to ensure none of those show on your checkout page
    (WooCommerce > Settings > Checkout tab)
  • Disable shipping altogether, or if you want visitors to decide whether to request shipping price, enable and relabel two different shipping methods and set them up both to be FREE
  • Disable registration on checkout and my account page and turn off displaying log in reminders unless you want to handle users on your catalog site as well
    (WooCommerce > Settings > Accounts tab)
  • Disable every single customer email, or if you want to send a confirmation email about the requests to the customer, just disable the completed order emails to avoid unnecessary duplicates and invoices about free orders (that virtually won’t even exist)
    (WooCommerce > Settings > Emails tab)
Step 3: Relabeling

In this step we’ll make sure that your site looks nothing like you’re giving away stuff for free. For this reason we’ll rewrite your buttons and hide free notices.

Just add the code below to your theme’s functions.php or to your very own plugin.

3.1: No ‘Free’ label

The first and foremost substep is to hide free shipping notices and labels on the single product page and the product loops e.g. shop and product category pages.

add_filter( 'woocommerce_free_price_html', 'hide_free_price_notice'); add_filter( 'woocommerce_variable_free_price_html', hide_free_price_notice' ); add_filter( 'woocommerce_variation_free_price_html', 'hide_free_price_notice' ); function hide_free_price_notice( $price ) { return ''; } 3.2: Button labels

While creating your catalog we are gradually transforming your cart into a wishlist and your checkout page into a price request form. First we need to relabel the buttons.

add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); function woo_custom_cart_button_text() { return __( 'Add to Wishlist', 'woocommerce' ); } add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' ); function woocommerce_button_proceed_to_checkout() { $checkout_url = WC()->cart->get_checkout_url(); <?php <a href="<?php echo $checkout_url; ?>" class="checkout-button button alt wc-forward"><?php _e( 'Request prices', 'woocommerce' ); ?></a> ?> } add_filter( 'woocommerce_order_button_text', create_function( '', 'return "Send me an offer";' ) ); 3.3: Hide your free prices everywhere

WooCommerce shows your $0 prices in your cart (or, in this case, the Wishlist) so we must remove those columns. You have two options for that.

One, you can use CSS by adding this to your child theme’s style.css.

.cart_totals h2, .cart_totals .shop_table , .cart-subtotal, .order-total, .woocommerce-shipping-fields, .product-total{ display:none; }

Two, you can delete the unwanted columns altogether. In order to do this, we’ll overwrite the cart template files as follows:

  1. Create a woocommerce folder with a cart subfolder in your (child) theme’s folder so you’ll end up with something like this: wp-content/themes/mytheme/woocommerce/cart/
  2. Download and open the original woocommerce cart.php with a text editor; the file should be here: wp-content/plugins/woocommerce/templates/cart/
  3. Delete these lines:
    <th class="product-price"><?php _e( 'Price', 'woocommerce' ); ?></th>
    <th class="product-subtotal"><?php _e( 'Total', 'woocommerce' ); ?></th>
    and the section starting with <td class="product-price" and ending in </td>
    and the section starting with <td class="product-subtotal" and ending in </td>
  4. Download and open the original woocommerce cart-totals.php with a text editor; the file is where you found cart.php
  5. Delete these lines:
    <h2><?php _e( 'Cart Totals', 'woocommerce' ); ?></h2>
    and the whole table, starting with <table cellspacing="0" class="shop_table shop_table_responsive"> and ending with </table>
  6. Upload both files you have just edited into the woocommerce/cart folder within your theme directory

If you allowed users any sort of shipping options in Step 2 above, we need to disable the free shipping notice as well, like so:

add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_free_label', 10, 2 ); function remove_free_label($full_label, $method){ $full_label = str_replace("(Free)","",$full_label); return $full_label; } Step 4: Email text settings

We’re getting really close to having our very own WooCommerce catalog with the price request option. In fact, if in Step 2, you disabled every customer email altogether, you can just proceed to the Step 5.

If you want to send customer confirmation (as it is very elegant), we just need to make sure that we have our email subjects right and that we don’t send any $0 prices, and also maybe rewrite our email text a bit.

4.1. Email subject and heading

In the admin area, WooCommerce > Settings > Emails tab, you need to rewrite Processing order, because new requests will be in a processing status as customers are unable to instantly pay for them. For clarity, it’s best to rewrite your very own admin notification email (New order).

4.2. Remove price from emails

By default, the prices are sent with the order confirmation, so we need to overwrite the original email templates.

  1. Download and open the original woocommerce email-order-items.php with a text editor; the file should be here: wp-content/plugins/woocommerce/templates/emails/plain
  2. Delete this line:
    echo "\n" . sprintf( __( 'Cost: %s', 'woocommerce' ), $order->get_formatted_line_subtotal( $item ) );
  3. Download and open the original woocommerce email-order-details.php with a text editor; the file should be here: wp-content/plugins/woocommerce/templates/emails/plain
  4. Delete these lines: if ( $totals = $order->get_order_item_totals() ) { foreach ( $totals as $total ) { echo $total['label'] . "\t " . $total['value'] . "\n"; } }
  5. Upload both files you just edited into the woocommerce/emails/plain folder within your theme directory
4.3. Rewrite flavor texts

By default, WooCommerce will introduce your emails by the following: "Your order has been received and is now being processed. Your order details are shown below for your reference".

If you want to overwrite this, you need to follow these 3 steps:

  1. download and open the original woocommerce customer-processing-order.php with a text editor; the file should be here: wp-content/plugins/woocommerce/templates/emails/
  2. rewrite the line responsible for the text above as you wish:
    echo __( "Your order has been received and is now being processed. Your order details are shown below for your reference:", 'woocommerce' ) . "\n\n";
  3. upload the file you just edited into the woocommerce/emails folder within your theme directory
Step 5: Enjoy

Now that you have your very own WooCommerce-powered catalog, you may sit back and enjoy what you’ve created. When anyone creates a wishlist and send you a price request, you’ll receive an email about it, plus their request will show up in your admin area under WooCommerce > Orders.

Every order will contain the email address of your customer-to-be, so you can manually send them your price offer, or maybe even contact them on phone.

Editor’s note: This is written by Marton Fekete for Hongkiat.com. Marton is a Hungarian site developer recently hooked on WordPress. He is a redesign enthusiast and freelance content writer who likes playing RPGs in his free time.

15 Online Typography Tools All Designers Should Know

hongkiat.com - di, 26/04/2016 - 15:01

Typography is the foundation of any design, because reading is one of the most basic things we do on the web. The typography you choose have an impact on multiple aspects of a website, including readability, mood, and the overall user experience. It’s essential for designers and developers to know the basic principles of typography to create readable pleasing designs.

We have been talking about font pairing tools before, and today we’re going to share with you type tools that can you achieve a better reading experience in the websites you build and/or design.

Here are the plugins, online tools, and scripts which will help you to create awesome headlines and clean readable text.

Typeplate

It will not make design choices for you, but will define the right markup with styling for common typographic templates. It can also give you tips on how to style text copy properly.

Check out: Demo | Documentation

Gutenberg

Gutenberg is a flexible and easy-to-use typography starter kit for developers and designers. It will help you to set base type size, line-height and max width. Gutenberg is an open-source project, so feel free to contribute, adapt and modify it.

Check out: Demo | Documentation

Lettering.js

Lettering.js is a jQuery plugin which gives you control over kerning type. It allows you to get editorial design with ease and manage code. The website features amazing examples of typography made with this plugin for inspiration.

Check out: Demo | Documentation

Typebase.css

Typebase.css is a customizable typography stylesheet. It contains both saas and less versions and is easily modified into modern web projects.

Check out: Demo | Documentation

FitText

FitText is a plugin which will make your website font-sizes flexible. It will help you achieve scalable headlines for various screen resolutions; in other words, make your typography responsive. It’s made for displaying huge text only.

Check out: Demo | Documentation

Kerning.js

Kerning.js helps you to automatically transform, scale, and modify your typography with CSS. It’s easy to get started with Kerning.js.

Check out: Demo | Documentation

Typesettings.css

Typesettings.css is your playground for creating minimalistic web projects or blogs. All typography styles used here are inspired by graphic design basics.

Check out: Demo | Documentation

Rucksack

With Rucksack you can produce amazing fluid typography thanks to a new, responsive property on the font size. Creating responsive typography is made exceptionally easy.

Check out: Demo | Documentation

FlowType.JS

The most readable typography contains between 45 and 75 characters per line but to find that balance is a challenging task for developers. FlowType.JS changes the font size and subsequently the line-height based on a specific element’s width.

Check out: Demo | Documentation

Blast.js

Blast.js will help you to separate texts to make it easier to manipulate the typography. It contains 4 in-built delimiters: character, word, sentence, and element. It can also match custom expressions and phrases.

Check out: Demo | Documentation

slabText

slabText is a simple script which splits headlines into rows to perfectly fill in the available horizontal space. The script calculates an ideal number of characters to set in each row by dividing available width by pixel font size.

Check out: Demo | Documentation

Type Scale

With Type Scale you’re able to preview and choose the right type scale for your project. There are no rules – just play around with font size, scale and different web fonts.

Check out: Demo | Documentation

Typographic

Typographic helps you to make typography responsive. All you need to do is just select a few fonts, set a few settings and you’ll get nice responsive typography.

Check out: Demo | Documentation

Typi

Typi is a saas mix you can use to make responsive typography with ease. It creates font size and line heights for HTML and other elements. Also, Typi has a vertical rhythm function to calculate line heights.

Check out: Documentation

Lining.js

With the Lining.js plugin, you’ll get complete control over web typography. It’s supported on most popular browsers like Safari, Google Chrome, Opera, and Mozilla Firefox.

Check out: Demo | Documentation

Bonus: 2 More Tools! State of Web Type

State of the Web Type is a website that offers up-to-date data about the support for type and features around the web. You can use search or categories, such as kerning, capital spacing, CSS font loading, and more to find exactly what you need.

Typograph

Typograph is an awesome web and sketch plugin which allows you to put non-breaking spaces after one-letter words, connect the number and the unit. It also removes double spaces, enters, dots and other typos, so you can achieve clean beautiful typography that is easy to read.

Check out: Documentation

11 Dependency Management Tools for Web Developers

hongkiat.com - ma, 25/04/2016 - 17:01

Dependencies are a cornerstone of modern web development. These are the required tools, plugins, libraries and frameworks necessary to build high-level web applications.

The sheer number of dependencies has skyrocketed in the last few years. Over time developers have adopted dependency management tools which alleviate the stress of keeping dependencies organized and up-to-date. These tools lead to an optimized workflow for developers and project managers.

I’ve cataloged the best dependency tools here including both well-established and newly-emerging platforms. Professional web development requires continuous learning and I’d argue dependency management is a skillset worth learning.

1. NPM

I couldn’t write this guide without giving credit to the Node Package Manager. Built on Node.js, this system powers a tremendous repository of 100,000+ packages and modules.

Each project can use a package.json file setup through NPM and even managed with Gulp(on Node). Dependencies can be updated and optimized right from the terminal. And you can build new projects with dependency files and version numbers automatically pulled from the package.json file.

NPM is valuable for more than just dependency management, and it’s practically a must-know tool for modern web development. If you’re confused please check out this Reddit thread for a beginner’s explanation.

2. Bower

The package management system Bower runs on NPM which seems a little redundant but there is a difference between the two, notably that NPM offers more features while Bower aims for a reduction in filesize and load times for frontend dependencies.

Check out this Stack question to learn more about the subtle differences.

Some devs argue that Bower is basically obsolete since it runs on NPM, a service that can do almost everything Bower can do. Generally speaking this isn’t wrong.

But devs should realize Bower can optimize the workflow specifically with frontend dependencies. I recommend Ben McCormick’s article Is Bower Useful to learn more about the value offered from both package management tools.

3. RubyGems

RubyGems is a package manager for Ruby with a high popularity among web developers. The project is open source and inclusive of all free Ruby gems.

To give a brief overview for beginners, a “gem” is just some code that runs on a Ruby environment. This can lead to programs like Bundler which manage gem versions and keep everything updated.

Rails developers will love this feature, but what about frontend packages? Since Ruby is open source, developers can build projects like Bower for Rails. This brings frontend package management to the Ruby platform with a small learning curve.

4. RequireJS

There’s something special about RequireJS in that it’s primarily a JS toolset. It can be used for loading JS modules quickly including Node modules.

RequireJS can automatically detect required dependencies based on what you’re using so this might be akin to classic software programming in C/C++ where libraries are included with further libraries.

You’ll find an interesting GitHub discussion on this topic and the value it offers modern web developers. Granted other JS management tools like webpack have popped up, RequireJS still works in production environments. And if it works for you that’s all that matters.

5. Jam

Browser-based package management comes in a new form with JamJS. This is a JavaScript package manager with automatic management similar to RequireJS.

All your dependencies are pulled into a single JS file which lets you add and remove items quickly. Plus these can be updated in the browser regardless of other tools you’re using (like RequireJS).

Libraries are updated based on the latest versions through the terminal. Each project can be created automatically with optimized components based on your needs. Jam is free on GitHub and worth a look if you have the time.

6. Browserify

Most developers know of Browserify even if it’s not part of their typical workflow. This is another dependency management tool which optimizes required modules and libraries by bundling them together.

These bundles are supported in the browser which means you can include and merge modules with plain JavaScript. All you need is NPM to get started and then Browserify to get moving.

Check out this intro tutorial to see how Node can be managed right in the browser. There’s also a lengthy Browserify handbook hosted on GitHub for free. The idea is to bring all these Node tools into the browser and save time by automating the process with Browserify.

7. Mantri

Still in its early stages of growth, MantriJS is a dependency system for mid-to-high level web applications. Dependencies are managed through namespaces and organized functionally to avoid collisions and reduce clutter.

Mantri is currently at v0.2.2 at the time of writing. It’s completely open source and built for more complex web applications that require large bundles of dependencies. Mantri aims to follow modular programming practices and hopes to encourage developers onto the same path.

8. Volo

The project management tool volo is an open source NPM repo that can create projects, add libraries, and automate workflows.

Volo runs inside Node and relies on JavaScript for project management. A brief intro guide can be found on GitHub explaining the installation process and common usage. For example if you run the command volo create you can affix any library like HTML5 Boilerplate.

But aside from creating new projects you can also add/update libraries for older projects. Volo ties into everything you would need for frontend development. Check out volo’s design goals to see how it operates in a real-world project.

9. Ender

Ender is the “no-library library” and is one of the lightest package managers you’ll find online. It allows devs to search through JS packages and install/compile them right from the command line. Ender is thought of as “NPM’s little sister” by the dev team.

Naturally the whole Ender framework is available for free on GitHub. It’s simply a tool that you install to help manage consumption of frontend JavaScript frameworks for local projects. Everything is meant to run with ease to the fullest potential for a frontend developer’s workflow.

The main Ender website has quality documentation so it’s worth a glance if you’re interested.

10. pip

The recommended method for installing Python dependencies is through pip. This tool was created by the Python Packaging Authority and it’s completely open source just like Python itself.

The majority of Python developers recommend pip for dependencies including the Django team. Whether you’re just getting started with Python or already use it consistently with backend development, this is a package manager you’ll be glad to have in your toolbox.

11. Composer

Composer is a package manager very similar to NPM, but it’s focused solely on PHP libraries. You can find a list of dependencies on Packagist which includes large PHP frameworks such as Laravel.

If you’re a PHP developer of any kind I seriously recommend looking into Composer. It’s easy to get started but difficult to fit into your workflow. However with practice it’ll become a staple for PHP dev projects.

This is a versatile tool with the potential to grow even larger in time. Plus NPM can mix with Composer to create a frontend + backend dependency management system for all your PHP/JS projects.

Wrapping Up

It’s clear many of these dependency managers have similar traits with similar qualities. Some are built to solve alternate problems and can even run in tandem with each other (ie. Composer and NPM).

The subject of dependency management can be tough for new developers. I recommend picking one of these tools and researching in-depth to learn as much as possible. Try building small webapps and learn why dependency management is useful.

Once you learn how to apply these tools into your workflow you’ll never consider going back.

10 Smart Routers That Solve All Your WiFi Problems

hongkiat.com - ma, 25/04/2016 - 15:01

We are spending more and more of our lives online than off and WiFi connectivity has become a necessity in many households, restaurants, tourist attractions, public facilities, travel hubs and places of accommodation like hotels and resorts. For high quality, uninhibited and secure Internet access, you should be using a smart WiFi router. We have a few to introduce to you in this post.

Most of these routers have unique capabilities and solutions to some of the most common connectivity problems that plague Internet users. You shouldn’t feel like you need a programmer or developer to help you fix router-related problems; if you do, that’s what these routers are here for.

They’re smart and easy to use and you probably will be saying, "where have you been all my life?" a lot, by the end of the post.

Eero

Do you experience WiFi dead zones or dead spots at home or at the office? A dead zone is a place where you can’t seem to connect to your WiFi. It might be caused by thick walls or by being just too far from the source of your WiFi. Some users may solve this by switching the channel their WiFi network is on. But if you can afford it, why not get eero to let you solve your dead zone problems for you?

Eero uses state-of-the-art WPA2 to control both software and hardware and once you are on this Wi-Fi router you never need to reset your router again. When guests come to visit you need not be dictating your password to them, just invite them to connect and once they accept, they are on the connection. Get Eero for $499 and you get 1 year warranty.

Starry

Starry gives you smart features in controlling Wi-Fi usage. This is a touchscreen Wi-Fi router which can be controlled through your smartphone. Under its ambient mode you can see the health of your devices: blue for healthy and red for not. The interactive mode provides you with the health score of your devices, your internet speed, and all the activities of your online access.

Starry lets parents manage the sort of content their children can or cannot access. It will also generate an activity map indicating what activity uses the most data and how much screen time was spent online. Starry also gives very good coverage, allowing you to use it even outside of your home, within the vicinity. Get Starry for $349.99.

Circle

If you have kids at home who have access to the Internet but you don’t have the time to be constantly monitoring the amount of time they spend online, Circle is the router for you. It helps users to better manage their time with their devices. You can set when the connection is to be turned on or off for your chilren, for instance turning off Internet access when it is near bedtime.

Circle lets you preset connectivity based on age category: pre-kid, kid, teenage or adult. It also has a pause function, for when you’re in the middle of a thunderstorm or if you just need your kids to get off the couch. Circle also lets you block ads or annoying advertisements, search safely on the Internet, allow connection to a guest in your home. Get Circle for $99.

Torch

Torch is a router with parental control to help you better manage your children’s Internet activities. You could pause the connection so they kids can spend time on their homework without being distracted, go play outside or catch up on afternoon naps. It also lets you customize the sort of content you allow or don’t allow your children to access.

Each child with access to your Torch WiFi will get a profile and from there you can check their respective browsing histories and time spent online for each of your children. You can also separate the profile of a child from that of an adult. Get Torch for $249.99.

Keezel

If you value your privacy online and would like to access blocked TV shows, sports games or websites, Keezel is the device for you. It connects to your WiFi and provides you with VPN protection. Instead of connecting to just one service, it connects with multiple VPN networks and chooses the one with the best available connection for your browsing needs.

To access TV shows that are not available in your region, just connect Keezel to your WiFi Network then choose the country where the TV show is available. You can have Keezel at $90 for the device, and $60 for one-year service.

Luma

Luma is a WiFi that checks your speed ensuring you are always running full speed at all times. It also allows parental control, pausing the connection for dinnertime or other family activities, and you can see how many devices are connected to your WiFi at all times. You can approve or deny access to any particular device right on your smartphone.

Luma also lets you schedule when your connection will disconnect or when it should reconnect. Luma has the added capability to protect from hackers, viruses, and can help intruders out. You can preorder Luma for $149.

Kisslink

Kisslink allows you to connect WiFi without using a password. It has this technology called KISS™ proximity, which will not only securely protect your network but also allow a device to connect via close proximity to the router, bypassing the need for password setups. Setup involves plugging it into a power source and an Internet source and it’s good to go.

Kisslink runs on a custom Linux-based OS and a business-grade WiFi driver. This helps ensure that your signals are fast, stable and reliable. As for connectivity issues, the Zen Button™ included in the router will help you resolve any issue related to the more than 300 parameters it can control. No more powercycling your routers.

OnHub

Use Google’s OnHub routers to pick the fastest WiFi network in your home/office, assign the fastest speeds to a particular device with a higher priority (for streaming movies for example), and has an innovative circular antenna to get better signals. It includes smart technology like Bluetooth® Smart Ready, 802.15.4 and Weave, and claims to be able to connect up to 128 devices.

The router also contains 4GB storage space so it has plenty of space to auto-update its own software. It is available in two forms by two different manufacturers. The Asus one lets you boost WiFi for a particular device with a wave ($219.99) whereas the one by TP-Link (colors are customizable) has an antenna reflector to gain a better range in one direction ($199.99).

GRAMOFON

Gramofon is made for users who love music. It is a device that can connect and play music directly from a site. Just plug Gramofon into your audio system with a cable, configure it based on your preferences using your smartphone, and it can start playing the tunes you like from the Internet.

You can have more than one Gramofon for wider coverage all around the area, and sync the Gramofons with Qualcomm AllPlay to enjoy the same (or different) tunes in different rooms. Gramofon works with Spotify, SoundCloud, QQ Music and more music-streaming services. It costs €59 per unit.

Linting JavaScript with JSHint

hongkiat.com - vr, 22/04/2016 - 17:01

Linting in computer programming is the process of static analysing code to find issues like wrong syntax, and iffy usage of code. The tool used for linting is known as a lint or linter. One of the linters available for JavaScript today is JSHint.

JSHint is available for multiple platforms. The online web tool that most of us are familiar with is at jshint.com. There are also the command line tool via Node.js, a JavaScript API, multiple text editors, and IDE plugins for JSHint. You can see the full list of available JSHint tools for different environments in the download and install page of the JSHint website.

According to its website, the two most common ways the JSHint tool is used are as the command line tool and the API. Let’s take a look at how you can download use both, along with other linting optiosn the tools provide.

Via Command Line Tool

(1) If you haven’t have Node.js installed in your computer, then you’ll have to go its website and download and install it first. To check if Node.js has been successfully installed you can run the command npm -version in the command-line interface (CLI) and it’ll show you the version of the Node.js in your computer (or you can just run the command npm and see what happens).

(2) To install the JSHint tool, run the command npm install jshint in CLI. If you want to check if JSHint has been successfully installed, run the command jshint -version to see its version. Once this step is over, installation is complete.

(3) To run the tool, go to the directory in the CLI where your JavaScript file (say test.js) is and run the command jshint test.js. The result of the tool’s analysis on your JavaScript code will appear (something like this):

Via The JavaScript API

(1) Download the compressed file from this GitHub link, and unzip it. In the dist folder you’ll find the jshint JS file (the API library).

(2) To use the API, add the jshint JS file to your project and link it to your page. The API can be accessed in the JavaScript code using the function/object called JSHINT. Below is a sample HTML code where JSHint’s JavaScript API is used to analyse the JavaScript code present in the source array and display the analysis results on the page.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script src="jshint.js"> </script> <script> /* Array containing the JavaScript code to be analysed */ var source = [ 'var obj = {}', 'foo();' ]; /* Linting options (optional) */ var options = { undef: true, unused: true }; /* API is invoked */ JSHINT(source); /* The tool's analysis output is written on the page after the JSON object -> String conversion */ document.write(JSON.stringify(JSHINT.data())); </script> </body> </html>

(3) We passed the source array containing the JavaScript source code to be analysed and options object containing linting options (we’ll go into options shortly) as parameters to the JSHINT function. The analysis result (a JSON object) is fetched from JSHINT‘s function property called data.

(4) JSON.stringify is used for display-only here, to display the result returned from the data function in string format on the page. The beautified JSON string looks like this. The highlighted parts are the errors found by JSHint worded in simple sentences.

Linting Options

Linting options let us configure the linting process. We can specify which type of errors or wanring need to be linted and which don’t. In the previous example two linting options were used namely undef and unused.

undef option flags undeclared variables, and unused will flag variables that were declared but never used. Like these there are many more options that you can see a list of in this page, if you want to search an option, there’s a search bar provided at the top right corner.

If you’re using the CLI tool via Node.js, you can write the linting options inside a package.json file under the property jshintConfig in the same directory. You can also add the options as directives in the JavaScript code.

// -- test.js -- /* jshint undef: true, unused: true */ foo(); a = 7;

There are more ways to configure linting options in your project based on the tool you’re using. Check out the different ways for configuration here.

How to Post in Multiple Languages on A Facebook Page

hongkiat.com - vr, 22/04/2016 - 15:01

A Facebook page is a fast yet effective way to reach global audiences quickly. That is why brands, products, businesses and services have their own Facebook pages set up, usually in their native language or the lingua franca of the region they are in. However, to be able to publish in multiple languages widens the demographics of audiences that can be reached.

With that thought in mind, if you have always wanted to post in multiple languages on your Facebook page, you can because it’s a feature that is available to admins of Facebook Pages, if you know how to turn it on.

Just follow these steps to start publishing content in more languages than one.

  1. Click on Settings at the top right hand corner of your Facebook page.
  2. In Settings, locate the Post in Multiple Languages option and click on Edit.
  3. Click on the checkbox to allow the admin(s) of the page to write posts in multiple languages and click on Save Changes.
  4. Click on Write something… (textbox) on your Facebook page, and you will see the Write post in another language option right below the textbox. Click on it and you will see the default language for your page, which you can change if you want.
  5. Start writing a post, click on Write post in another language and then click Select to see a list of available languages. Choose the language you want to write in and key in your status. Repeat the same process for other languages you might want to include. Once you are done, click the Publish button.
  6. So now, whenever one of your fans land on your Facebook page and see this status, they can choose to see the status update in whichever of the languages you published in.
  7. To do so, they need to click on the Viewing: English dropdown arrow to see a list of all the languages that you have included. That’s it.

If you own a Facebook page and a large portions of your readers read both English and another major or popular language then this is a way for you to communicate with the specific niches of your fans or followers. It’s also a better alternative than what Facebook’s in-house translation tool is providing.

Note: For this demo, we have used Google Translate for the non-English statuses, so the translations might not mean exactly the same as what the English counterpart is trying to deliver. Don’t look at us, translation isn’t an exact science yet or a feature you can fully automate yet.

(Cover image by Freepik.)

10 Programming Languages You Wouldn’t Want To Code In

hongkiat.com - do, 21/04/2016 - 17:01

Ever heard of Chicken, Whitespace and LOLCODE? They are names of bizarre programming languages that surprisingly exist. Programming languages are usually created to ease the coder’s work but there are a few languages that are built to tease the programming community.

These are known as obfuscated or esoteric programming languages (esoteric meaning it’s made only for a small group of people to understand and/or use). They are sometimes called bizzare or scary programming languages as well, for obvious reasons. Take a look at these 10 programming languages to see if you agree.

Taxi

Taxi looks like a roadmap language that road travellers will find easy to understand but not necessarily to code. It is the official programming language of Tiwnsville where the traditional coding language is replaced by a modern map language. Variables, classes or functions are replaced by places or cities in this language.

You map out taxi routes that ferry a passenger from one place to another and you’re required to give instructions about directions, pickups and drop offs. The taxis need fuel to run, hence passengers pay for their rides and you get cash for refuelling your taxi at the gas stations.

Here’s "Hello, World!" in Taxi language:

"Hello, World!" is waiting at the Writer's Depot. Go to Writer's Depot: west 1st left, 2nd right, 1st left, 2nd left. Pickup a passenger going to the Post Office. Go to the Post Office: north 1st right, 2nd right, 1st left. Go to the Taxi Garage: north 1st right, 1st left, 1st right. ZOMBIE

ZOMBIE is a programming language designed for necromancers (magic practitioners who talk to the dead). It allows its coders to write code to animate dead bodies, control spirits and solve computable problems through them. It has a guarantee against overwriting system memory and releasing malicious entries onto the Earth.

ZOMBIE comes in the form of entity declarations. In this language, syntax errors are extremely dangerous because demons may escape the CPU and create havoc in the world with incorrect binding commands. Its data values are free format and compatible with standard mathematics rules.

An example for printing "Hello, World!" in ZOMBIE language:

HelloWorld is a zombie summon task SayHello say "Hello, World!" animate animate BIT

BIT is a powerful low-level programming language where the coder gets full access to the entire data in its ASCII implementation. The manipulation of data is less complicated than high-level languages using specialized functions for abstract data types. There are two data types in BIT: bit and address-of-a-bit.

The data values in BIT can be operated using operators and commands. This language is strongly typed (i.e., data is always declared along with its type) and even supports the controversial "GOTO" flow control command. BIT allows any amount of whitespace and line breaks between syntax elements.

An example for printing "Hello, World!" in BIT language:

LINE NUMBER ZERO CODE PRINT ZERO GOTO ONE ONE ZERO ONE LINE NUMBER ONE CODE PRINT ZERO GOTO ONE ZERO LINE NUMBER ONE ONE CODE PRINT ZERO GOTO ONE ZERO ZERO ONE ZERO LINE NUMBER ONE ZERO CODE PRINT ONE GOTO ONE ONE LINE NUMBER ONE ONE ONE CODE PRINT ONE GOTO ONE ZERO ONE LINE NUMBER ONE ZERO ONE CODE PRINT ZERO GOTO ONE ONE ZERO LINE NUMBER ONE ONE ZERO CODE PRINT ONE GOTO ONE ZERO ZERO LINE NUMBER ONE ZERO ZERO CODE PRINT ONE GOTO ONE ONE ONE ONE LINE NUMBER ONE ONE ONE ONE CODE PRINT ZERO GOTO ONE ZERO ONE ONE LINE NUMBER ONE ZERO ONE ONE CODE PRINT ZERO GOTO VARIABLE ONE LINE NUMBER ONE ONE ZERO ONE CODE PRINT ONE GOTO ONE ONE ONE ZERO LINE NUMBER ONE ONE ONE ZERO CODE PRINT ZERO GOTO ONE ZERO ZERO ONE LINE NUMBER ONE ZERO ZERO ONE CODE PRINT ZERO GOTO ONE ZERO ONE ZERO LINE NUMBER ONE ZERO ONE ZERO CODE PRINT ONE GOTO ONE ONE ZERO ZERO LINE NUMBER ONE ONE ZERO ZERO CODE PRINT ZERO GOTO ONE ZERO ZERO ZERO LINE NUMBER ONE ZERO ZERO ZERO CODE PRINT ZERO GOTO ONE ONE ONE ONE ONE LINE NUMBER ONE ONE ONE ONE ONE CODE PRINT ZERO GOTO ONE ZERO ONE ONE ONE LINE NUMBER ONE ZERO ONE ONE ONE CODE PRINT ZERO GOTO ONE ONE ZERO ONE ONE LINE NUMBER ONE ONE ZERO ONE ONE CODE PRINT ONE GOTO ONE ONE ONE ZERO ONE LINE NUMBER ONE ONE ONE ZERO ONE CODE PRINT ONE GOTO ONE ONE ONE ONE ZERO LINE NUMBER ONE ONE ONE ONE ZERO CODE PRINT ZERO GOTO ONE ZERO ZERO ONE ONE LINE NUMBER ONE ZERO ZERO ONE ONE CODE PRINT ZERO GOTO ONE ZERO ONE ZERO ONE LINE NUMBER ONE ZERO ONE ZERO ONE CODE PRINT ONE GOTO ONE ZERO ONE ONE ZERO LINE NUMBER ONE ZERO ONE ONE ZERO CODE PRINT ZERO GOTO ONE ONE ZERO ZERO ONE LINE NUMBER ONE ONE ZERO ZERO ONE CODE PRINT ONE GOTO ONE ONE ZERO ONE ZERO LINE NUMBER ONE ONE ZERO ONE ZERO CODE VARIABLE ONE EQUALS ONE ONE ONE ZERO ZERO GOTO ONE LINE NUMBER ONE ONE ONE ZERO ZERO CODE VARIABLE ONE EQUALS ONE ZERO ZERO ZERO ONE GOTO ONE LINE NUMBER ONE ZERO ZERO ZERO ONE CODE VARIABLE ONE EQUALS ONE ONE ONE ONE ZERO ONE GOTO ONE ONE LINE NUMBER ONE ZERO ZERO ONE ZERO CODE PRINT ONE GOTO ONE ZERO ONE ZERO ZERO LINE NUMBER ONE ZERO ONE ZERO ZERO CODE PRINT ONE GOTO ONE ONE ZERO ZERO ZERO LINE NUMBER ONE ONE ZERO ZERO ZERO CODE PRINT ZERO GOTO ONE ZERO ZERO ZERO ZERO LINE NUMBER ONE ZERO ZERO ZERO ZERO CODE PRINT ONE GOTO ONE ONE ONE ONE ONE ONE LINE NUMBER ONE ONE ONE ONE ONE ONE CODE PRINT ONE GOTO ONE ZERO ONE ONE ONE ONE LINE NUMBER ONE ZERO ONE ONE ONE ONE CODE PRINT ONE GOTO ONE ONE ZERO ONE ONE ONE LINE NUMBER ONE ONE ZERO ONE ONE ONE CODE PRINT ONE GOTO ONE ONE ONE ZERO ONE ONE LINE NUMBER ONE ONE ONE ZERO ONE ONE CODE PRINT ZERO GOTO VARIABLE ONE LINE NUMBER ONE ONE ONE ONE ZERO ONE CODE PRINT ZERO GOTO ONE ONE ONE ONE ONE ZERO LINE NUMBER ONE ONE ONE ONE ONE ZERO CODE PRINT ZERO GOTO ONE ZEROZERO ONE ONE ONE LINE NUMBER ONE ZERO ZERO ONE ONE ONE CODE PRINT ONE GOTO ONE ZERO ONE ZERO ONE ONE LINE NUMBER ONE ZERO ONE ZERO ONE ONE CODE PRINT ZERO GOTO ONE ZERO ONE ONE ZERO ONE LINE NUMBER ONE ZERO ONE ONE ZERO ONE CODE PRINT ZERO GOTO ONE ZERO ONE ONE ONE ZERO LINE NUMBER ONE ZERO ONE ONE ONE ZERO CODE PRINT ZERO GOTO ONE ONE ZERO ZERO ONE ONE LINE NUMBER ONE ONE ZERO ZERO ONE ONE CODE PRINT ZERO GOTO ONE ONE ZERO ONE ZERO ONE LINE NUMBER ONE ONE ZERO ONE ZERO ONE CODE PRINT ZERO GOTO ONE ONE ZERO ONE ONE ZERO LINE NUMBER ONE ONE ZERO ONE ONE ZERO CODE PRINT ZERO GOTO ONE ONE ONE ZERO ZERO ONE LINE NUMBER ONE ONE ONE ZERO ZERO ONE CODE PRINT ONE GOTO ONE ONE ONE ZERO ONE ZERO LINE NUMBER ONE ONE ONE ZERO ONE ZERO CODE PRINT ONE GOTO ONE ONE ONE ONE ZERO ZERO LINE NUMBER ONE ONE ONE ONE ZERO ZERO CODE PRINT ONE GOTO ONE ZERO ZERO ZERO ONE ONE LINE NUMBER ONE ZERO ZERO ZERO ONE ONE CODE PRINT ZERO GOTO ONE ZERO ZERO ONE ZERO ONE LINE NUMBER ONE ZERO ZERO ONE ZERO ONE CODE PRINT ONE GOTO ONE ZERO ZERO ONE ONE ZERO LINE NUMBER ONE ZERO ZERO ONE ONE ZERO CODE PRINT ONE GOTO ONE ZERO ONE ZERO ZERO ONE LINE NUMBER ONE ZERO ONE ZERO ZERO ONE CODE PRINT ONE GOTO ONE ZERO ONE ZERO ONE ZERO LINE NUMBER ONE ZERO ONE ZERO ONE ZERO CODE VARIABLE ONE EQUALS ONE ZERO ONE ONE ZERO ZERO GOTO ONE ONE LINE NUMBER ONE ZERO ONE ONE ZERO ZERO CODE PRINT ZERO GOTO ONE ONE ZERO ZERO ZERO ONE LINE NUMBER ONE ONE ZERO ZERO ZERO ONE CODE PRINT ONE GOTO ONE ONE ZERO ZERO ONE ZERO LINE NUMBER ONE ONE ZERO ZERO ONE ZERO CODE PRINT ONE GOTO ONE ONE ZERO ONE ZERO ZERO LINE NUMBER ONE ONE ZERO ONE ZERO ZERO CODE PRINT ONE GOTO ONE ONE ONE ZERO ZERO ZERO LINE NUMBER ONE ONE ONE ZERO ZERO ZERO CODE PRINT ZERO GOTO ONE ZERO ZERO ZERO ZERO ONE LINE NUMBER ONE ZERO ZERO ZERO ZERO ONE CODE PRINT ZERO GOTO ONE ZERO ZERO ZERO ONE ZERO LINE NUMBER ONE ZERO ZERO ZERO ONE ZERO CODE PRINT ONE GOTO ONE ZERO ZERO ONE ZERO ZERO LINE NUMBER ONE ZERO ZERO ONE ZERO ZERO CODE PRINT ZERO GOTO ONE ZERO ONE ZERO ZERO ZERO LINE NUMBER ONE ZERO ONE ZERO ZERO ZERO CODE VARIABLE ONE EQUALS ONE ONE ZERO ZERO ZERO ZERO GOTO ONE LINE NUMBER ONE ONE ZERO ZERO ZERO ZERO CODE PRINT ZERO GOTO ONE ONE ONE ONE ONE ONE ONE LINE NUMBER ONE ONE ONE ONE ONE ONE ONE CODE PRINT ONE GOTO ONE ZERO ZERO ZERO ZERO ZERO LINE NUMBER ONE ZERO ZERO ZERO ZERO ZERO CODE PRINT ONE GOTO ONE ZERO ONE ONE ONE ONE ONE LINE NUMBER ONE ZERO ONE ONE ONE ONE ONE CODE PRINT ZERO GOTO ONE ONE ZERO ONE ONE ONE ONE LINE NUMBER ONE ONE ZERO ONE ONE ONE ONE CODE PRINT ZERO GOTO ONE ONE ONE ZERO ONE ONE ONE LINE NUMBER ONE ONE ONE ZERO ONE ONE ONE CODE PRINT ONE GOTO ONE ONE ONE ONE ZERO ONE ONE LINE NUMBER ONE ONE ONE ONE ZERO ONE ONE CODE PRINT ZERO GOTO ONE ONE ONE ONE ONE ZERO ONE LINE NUMBER ONE ONE ONE ONE ONE ZERO ONE CODE PRINT ZERO GOTO ONE ONE ONE ONE ONE ONE ZERO LINE NUMBER ONE ONE ONE ONE ONE ONE ZERO CODE PRINT ZERO GOTO ONE ZERO ZERO ONE ONE ONE ONE LINE NUMBER ONE ZERO ZERO ONE ONE ONE ONE CODE PRINT ZERO GOTO ONE ZERO ONE ZERO ONE ONE ONE LINE NUMBER ONE ZERO ONE ZERO ONE ONE ONE CODE PRINT ONE GOTO ONE ZERO ONE ONE ZERO ONE ONE LINE NUMBER ONE ZERO ONE ONE ZERO ONE ONE CODE PRINT ZERO GOTO ONE ZERO ONE ONE ONE ZERO ONE LINE NUMBER ONE ZERO ONE ONE ONE ZERO ONE CODE PRINT ZERO GOTO ONE ZERO ONE ONE ONE ONE ZERO LINE NUMBER ONE ZERO ONE ONE ONE ONE ZERO CODE PRINT ZERO GOTO ONE ONE ZERO ZERO ONE ONE ONE LINE NUMBER ONE ONE ZERO ZERO ONE ONE ONE CODE PRINT ZERO GOTO ONE ONE ZERO ONE ZERO ONE ONE LINE NUMBER ONE ONE ZERO ONE ZERO ONE ONE CODE PRINT ONE Unlambda

Unlambda is a language mix of obfuscated and functional programming paradigms. In this language, everything is a function – even the data. It removes various crucial features: there is no way to store data or have variables and moreover, you can create functions but can’t name or save them. Oops.

Unlambda works only with functions: each function takes exactly one another function as an argument and returns just one yet another function. It does allow working with data structures and the like, but you must represent them as ad-hoc functions (everything is a function, after all).

An example for printing "Hello, World!" in Unlambda language:

```s``sii`ki ``s``s`ks ``s``s`ks``s`k`s`kr ``s`k`si``s`k`s`k `d````````````.H.e.l.l.o.,. .W.o.r.l.d.! k k `k``s``s`ksk`k.* Java2K

Java2K is a probabilistic language that works on the nature of the universe: “there is never absolute security, there is always only probability.” It doesn’t do whatever you intend for it to do; even the built-in functions work weird. However, it does source-code level checking for security and the language uses an 11-based number system – counting up to 9 and including 10.

The program always consists of 2 arguments – even if you need just one. There are two types of numbers: names of the objects and integer values. For every function in Java2K, there are various implementations and any of them is chosen randomly at the runtime. It has a number of restrictions on valid keywords and functions, and the language even offers a garbage collector to auto-release memory.

An example for printing "Hello, World!" in Java2K language:

1 1 /125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2 /*/_\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2 /*/_\/_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\ \\\\\\\/*\1 1 /125 /119 /11 6/*/_\/13 2/*/_\\/ 125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\ /125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_ \/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_ \/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_ \/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_ \/_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\ \\\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\ \\\\\\\/*\1 1 /125 /131 /119 /125 /11 6/*/_\/_\ /125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\/ 125 /13 2/*/_\/_\\\/125 /131 /119 /125 /11 6/*/ _\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/ _\/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\ /125 /13 2/*/_\/_\\\\/125 /131 /119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/ _\/125 /13 2/*/_\/_\\\\\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_ \/125 /13 2/*/_\/_\\\\\\\\\\/*\1 1 /125 /131 / 119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\/125 / 131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/ 131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/ 119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\\/ 125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\ \\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\\ \\\\\\/*\1 1 /125 /119 /11 6/*/_\/13 2/*/_\\/ 125 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/ 125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\ /125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_ \/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_ \/_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\ \\/125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2/* /_\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/* /_\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/* /_\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/* /_\/_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_ \\\\\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/ _\/_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\ \\\\\\\\\\\/*\1 1 /125 /131 /119 /125 /11 6/*/_ \/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\/ 125 /13 2/*/_\/_\\\/125 /131 /119 /125 /11 6/*/ _\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/ _\/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\ /125 /13 2/*/_\/_\\\\/131 /119 /125 /11 6/*/_\/ _\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\/ _\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\/ _\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\/ _\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\/ 125 /13 2/*/_\/_\\\\\\\\/*\1 1 /131 /119 /125 / 11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 / 11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 / 11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 / 11 6/*/_\/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\\\\\/*\1 1 /125 / 119 /11 6/*/_\/13 2/*/_\\/125 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/125 /131 /119 /125 / 11 6/*/_\/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\\/125 /131 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/119 /125 / 11 6/*/_\/_\/125 /13 2/*/_\/_\\\\\/131 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/131 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/119 /125 / 11 6/*/_\/_\/125 /13 2/*/_\/_\\\\\\\\\\\/*\ 1 1 /125 /119 /11 6/*/_\/13 2/*/_\\/125 /119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/125 /131 / 119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\/125 / 131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/ 131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/ 119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\\/ 125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\ \\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\\ \\\\\\\\/*\1 1 /125 /119 /125 /11 6/*/_\/_\/ 125 /13 2/*/_\/_\\/125 /131 /119 /125 /11 6/*/_ \/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_ \/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_ \/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\/ 125 /13 2/*/_\/_\\\\\/125 /131 /119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/ */_\/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/ _\/125 /13 2/*/_\/_\\\\\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/* /_\/_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_ \/125 /13 2/*/_\/_\\\\\\\\\\/*\1 1 /125 /131 / 119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/119 / 125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\/125 / 131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/ 131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\/ 119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\\/

125 /131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\ /_\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\ \\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/131 /119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/ _\\/119 /125 /11 6/*/_\/_\/125 /13 2/*/_\/_\\\\ \\\\\\/*\1 1 /125 /131 /119 /125 /11 6/*/_\/_\/ 125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\/125 / 13 2/*/_\/_\\\/125 /131 /119 /125 /11 6/*/_\/_\ /125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\/_\ /125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\/_\ /125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\/_\ /125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\/ 125 /13 2/*/_\/_\\\\\\/131 /119 /125 /11 6/*/_\ /_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\ /_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\ /_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\ /_\/125 /13 2/*/_\/_\\/131 /119 /125 /11 6/*/_\ /_\/125 /13 2/*/_\/_\\/119 /125 /11 6/*/_\/_\/ 125 /13 2/*/_\/_\\\\\\\\\/*\ Deadfish

Deadfish is an odd interpreted language, which was originally programmed in just few hours using the C language. Deadfish has just 4 commands in total: all for outputting things but none for inputting things (I did say it was odd). The language is case-sensitive, and it can deal only with integer values while adding or subtracting.

Its standard shell doesn’t accept anything that’s not a command. However, there is no way of catching or reporting errors at runtime, and the shell simply prints a newline for any error. Its name "Deadfish", was given because programming in this language feels as unpleasant as eating rotten dead fishes.

An example for printing "Hello, World!" in Deadfish language:

iisiiiisiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiooiiio dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddo dddddddddddddddddddddsddoddddddddoiiioddddddoddddddddo Emmental

Emmental is a self-modifying programming language defined by a meta-circular interpreter. It’s a stack-based language with just 13 instructions and its stack may only contain ASCII characters. Though not supported directly, conditional branching can be done in this language using the eval instruction ‘?’.

Though Emmental may look alien compared with other obfuscated languages, its English semantics make things less troublesome than other such languages. You can do primitive arithmetic, stack and queue manipulation (yes, it has got one queue too) and much more using Emmental language.

An example for printing "Hello, World!" in Emmental language:

;#58#126#63#36!;#46#36#!;#0#1!;#0#2!;#0#3!;#0#4!;#0#5!;#0#6!;#0#7!#0#33#100#108#114#111#119#32#44#111#108#108#101#72$ Whenever

Whenever is a language without any urgency or execution sequence: it does things whenever it feels like it and not per the sequence specified by the programmer. Just think of what will happen if a mail to your boss is sent before/without checking for spelling mistakes. Yes, that nightmare you just dreamt up is what you get with Whenever.

Whenever doesn’t "believe" in variable or data structures because it doesn’t care for program sequence. However, it does provide constructs to reassign things if a particular line of code have a prerequisite that’s not yet prepared. Unlike a few other languages, it does support strings and compound statements.

An example for printing "Hello, World!" in Whenever language:

1 print("Hello, World!"); INTERCAL

INTERCAL (aka Compiler Language With No Pronounceable Acronym) is a language that criticizes various languages at the same time. INTERCAL makes things absurd for programmers with construct statements like ‘PLEASE’, ‘FORGET’, ‘IGNORE’ and more. The coder must use ‘PLEASE’ often enough else the program is considered impolite and the compiler reports the same as an error. (It’s not programming unless there is an element of torture for some.)

INTERCAL was developed completely different from other programming languages. However, unlike other obfuscated languages like Unlambda and Deadfish, it does offer lots of data structures, operators and control structures. And yet, at the end of the day, these do not reduce its complexity.

An example for printing "Hello, World!" in INTERCAL language:

DO ,1 <- #13 PLEASE DO ,1 SUB #1 <- #238 DO ,1 SUB #2 <- #108 DO ,1 SUB #3 <- #112 DO ,1 SUB #4 <- #0 DO ,1 SUB #5 <- #64 DO ,1 SUB #6 <- #194 DO ,1 SUB #7 <- #48 PLEASE DO ,1 SUB #8 <- #22 DO ,1 SUB #9 <- #248 DO ,1 SUB #10 <- #168 DO ,1 SUB #11 <- #24 DO ,1 SUB #12 <- #16 DO ,1 SUB #13 <- #162 PLEASE READ OUT ,1 PLEASE GIVE UP Orthogonal

Orthogonal is an uncommon programming language in which the flow can go in any direction your wish. It’s a proof-of-concept experiment with a working interpreter. Its environment consists of two objects: the grid and the stack. The grid is the same as an array and a stack is a well-known one-dimensional entity.

Orthogonal, unlike various computer languages, is a 2-dimensional language and its instruction set falls into three categories: operators, directives and others. The language offers much more help to the coders than BIT, Deadfish and a few others. Moreover, it also supports data values and variables.

An example for printing "Hello, World!" in Orthogonal language:

0 'd' 'l' 'r' 'o' 'w' ' ' ',' 'o' 'l' 'l' 'e' 'h' s 0 c 0 ret

Do you dare to write programs in these obfuscated programming languages? Which is your favorite bizzare language and why? Do tell your answers using the comments section below.

Visual Studio Code: 5 Awesome Features That Make It A Frontrunner

hongkiat.com - do, 21/04/2016 - 15:01

Visual Studio Code is a new a code editor from Microsoft. It has recently hit its first major release cycle, 1.0.0. I’ve tried it for some times while it was in Beta, and I’m impressed with all it has brought to table this far.

Visual Studio Code (VSC) is lightweight and fast, and if you have used SublimeText or Atom before, you will immediately feel at home. VSC comes with a command palette, multiple cursor selection, snippets, and code auto-completion – the features that you surely are familiar with already.

Nonetheless, it also comes with its own signatures that makes it stand-out among the current players on the market. So, without further ado, let’s take a look.

1. Intellisense

IntelliSense is code auto-complete meets artificial intelligence. This utility provides a list of suggestions along with a short hint or description as we are writing codes. These is derived from several contextual factors such as the programming language, the syntax, the variables, the functions as well as all the codes within the file.

IntelliSense supports a number of programming language out-of-the-box, including Sass, LESS, JavaScript, TypeScript, and PHP. Some extensions to include IntelliSense for other programming languages are also available. It is a great feature to improve productivity.

2. Peek

While coding, you may often forget a particular function, where the function is initially defined, and what are the required parameters.

With Peek, you can select a function then hit Shift + F12. The selection expands into an inline window showing the complete definition of the function as well as where the function is defined. The feature currently works in C, C#, JavaScript, TypeScript, .NET, and a few other programming languages.

3. CLI

Similar to SublimeText with its subl command line, Visual Studio Code is equipped a CLI named code and it is easy to install.

In Windows, the CLI will have already been installed along with the app. The CLI is accessible through the Command Prompt. In OS X, it can be installed and uninstalled through the Command Palette.

You can use the CLI to open a particular directory to Visual Studio Code, or open your current project directory in Terminal or Command Prompt directly from the editor.

4. Built-in Git

Visual Studio Code has Git built right in the editor. On the left of the sidebar, you will find the Git icon where you can initialize Git as well as perform several Git commands such as commit, pull, push, rebase, publish, and look into the changes within the file.

In addition, if you are making changes on a Git repository, the Visual Studio will show color indicators in the code editor gutter, indicating where you have made the modifications.

We will dive into Git in Visual Studio Code in the next post, so stay tuned.

5. Task Runner

Last but not least, Visual Studio Code also has a built-in Task Runner, which provides some level of convenience.

To use this feature, we can either set a tasks.json file or through some popular Task configuration like Grunt, Gulp, or MSBuild if provided. Once the configuration is set, we can run the Task Runner through the Command Palette by typing Run Task. Typing Tasks will list all related commands.

Wrapping Up

The Visual Studio Code interface, the key combinations, as well as the command palette are intuitive and familiar. All in all, Visual Studio Code is a promising code editor even though there are a couple of features missing.

Nevertheless, I’m considering switching and adapting my workflow to Visual Studio Code. I’m looking forward to the next releases, hopefully, with substantial improvements.

Six jQuery Best Practices for Improved Performance

hongkiat.com - wo, 20/04/2016 - 17:01

jQuery is one of the most popular JavaScript libraries today. Its API is very easy to use leading to a not so steep learning curve. A lot of projects use jQuery code instead of directly using the vanilla JavaScript to bring in dynamic functionalities.

But jQuery has its shortcomings too. It can lead to some performance issues if used carelessly just like the language it’s based on. This post will list some of the best practices in using jQuery that will help us avoid any performance issues.

1. Lazy load scripts when needed

Browsers run JavaScript before creating the DOM tree and painting the pixels on the screen, because scripts can add new elements to the page or change the layout or style of some DOM nodes. So, by giving the browser less scripts to execute during page load, we can reduce the time it takes for the final DOM tree creation and painting, after which the user will be able to see the page.

One way to do this in jQuery is by using $.getScript to load any script file at the time of its need rather than during page load.

$.getScript( "scripts/gallery.js", callback);

It’s an ajax function that will get a single script file when you want it, but note that the file fetched isn’t cached. To enable caching for getScript you’ll have to enable the same for all of the ajax requests. You can do so by using the code below:

$.ajaxSetup({ cache: true }); 2. Avoid $( window ).load() if your script doesn’t need any sub-resources of the page

The $( document ).ready() is equivalent to DOMContentLoaded (where DOMContentLoaded is available) and $( window ).load() to Load. The first one is fired when a page’s own DOM is loaded, but not external assets like images and stylesheets. The second one is fired when everything a page is made up of, including its own content and its sub-resources are loaded.

So, if you’re writing a script that relies on a page’s sub-resources, like changing the background color of a div that’s styled by an external stylesheet, it’s best to use $( window ).load().

But, if that’s not the case, it’s better to stick to $( document ).ready() because, jQuery calls its ready event handler whether you use $( document ).ready() or not, so use it when you can.

3. Use detach to remove elements from DOM that needed to be changed.

“Reflow” is a term that refers to layout changes in a webpage, it’s when the browser rearranges a page’s elements to accommodate a new element, adjust to structural changes of an element, fill the gap left by an element removed , or some other action that needs a layout change in the page. reflow is an expensive browser process.

We can reduce the no. of reflows caused by structural changes to an element by performing the changes on it after taking it out of the page flow and putting it back when it’s done. If you’re adding multiple rows to a table one by one it’ll cause a lot of reflows. So it’s better to take the table out the DOM tree, add the rows to it and put it back to the DOM; this will reduce reflows.

jQuery’s detach() lets us remove an element from the page, it’s different from remove() because it’ll save the data associated with the element for when it needs to be added to the page later. A detached element can then be put back into the page when it has been modified.

4. Use css() to set height or width instead of height() and width()

If you’re setting the height or width of an element in jQuery, I suggest you use the css() function because setting those values using height() and width() will cause extra reflows due to the accessing of some layout properties in the function computeStyleTests in jQuery (tested in the latest ver.).

For the code p.height("300px"); here are the reflows.

For p.css({ "height": "300px"});

computeStyleTests is used to do some support tests. It’s also called while getting the height & width using both css() and height()/width() , but for setting it’s only called for height()/width() which may not be needed, so use css() instead.

5. Don’t access layout properties unnecessarily

Accessing layout properties like height, width, margin, etc. will trigger reflow in the page. The reason being whenever you ask the browser for any of the layout properties, it makes sure you get the updated value (in case the value has been invalidated before) by recalculating the values and applying any layout changes.

So whether you’re using jQuery or vanilla JavaScript, beware of accessing layout properties unnecessarily especially in a loop or consequently after making style changes.

6. Make use of caching where you can

Some of jQuery’s functions come with caching mechanisms that can be put to good use. Ajax requests do cache the resources, but it isn’t available for script and jsonp, so if you want caching across all your ajax requests, you may want to set it globally like below.

Also note that if you fetch resources using post it will not be cached even if you enable caching with the above setup.

Like I mentioned before, detach() caches the data associated with the element to be removed unlike remove();hide() caches the initial CSS display value of an element before hiding it so that it can be restored later without losing the data.

Conclusion

One way you can be sure that you’re using the most effective jQuery code for your need is to wait till you’ve actually run your code and noticed if there is any performance issue or not. If there’s, use the performance and debugger tools to detect the root of the issue.

Since jQuery is like a cocoon for JavaScript with additional functionalities for browser compatibilities and features, it can be difficult to diagnose the problems without these tools.

Developers: 10 UX/UI Tools to Have in Your Toolbox

hongkiat.com - wo, 20/04/2016 - 15:01

There are many different tools that can be used to build prototypes. Some are naturally better than others for a given situation, and others are among the best because they can be used in a wide variety of situations. If finding a top-of-the-line prototyping tool for your design work is your objective, you will find what you’ve been looking for among the tools presented here.

Also included, are several prototyping tools that feature usability testing capabilities, plus tools that are dedicated to this type of testing. Having usability testing capabilities at your fingertips gives you the ability to redesign or further refine UI elements. The importance of usability testing is all too often ignored or misunderstood. Overall, you should:

  • Make sure your search includes looking for a usability testing capability.
  • Be certain that the tool you select is compatible with the end product – website, or mobile or web app.
  • Make certain to get the interactive capabilities you need.
  • Make certain the tool you select is compatible with the size of your project or team.
InVision

Whether you are an individual designer or member of a small design team, InVision is the ideal prototyping platform to have at your disposal. Not only is it the leading UX/UI design and collaboration tool on the market, its usability testing capabilities are hard to match.

For very large teams, interdepartmental teams, or large and complex projects, look to InVision Enterprise Edition. For complicated projects involving many stakeholders, you naturally need near-perfect prototyping and collaboration solutions, and your choice of a usability testing tool can be a critical one.

The Enterprise Edition is the perfect solution. You can test your prototypes directly on user’s mobile devices, with no limit on the number of tests or users involved. Since you can capture their voices, and see their faces, you get a qualitative usability measure in addition to any quantitative information you may be looking for.

With InVision, no coding skills are needed, and you can build the first high-fidelity, clickable prototype for free.

Proto.io

Proto.io will make a great addition to your web design kit if you are in need of a prototyping and collaborating tool with which you can turn out high-fidelity prototypes in a very short amount of time. With Proto.io you can produce interactive, animated, feature-rich prototypes without coding.

There are times however, when even the best design efforts hit a few bumps in the road due to communication breakdowns. The collaboration features that come with this package simply don’t allow that to happen. You can count on delivering prototypes on time, and so realistic, that project managers and clients will not be able to distinguish them from the real thing.

Native iOS and Android mobile design elements are yours for the using, or you can import your own designs. You will like what Proto.io can do for you, and for your mobile app prototyping projects.

Appsee Mobile App UX Analytics

With its powerful usability testing capabilities that are ready for you to put to use, Appsee Mobile App Analytics will help you deliver the ultimate App user experience, time after time. "Ultimate" can be difficult if not impossible to achieve, if usability testing is poorly conducted or not conducted at all.

The Appsee creators recognize the power of qualitative user feedback. Since humans rely so heavily on visual information, user session recordings, when combined with touch heatmap data, provides designers with invaluable feedback for changing or refining UI elements or UX features or functions.

Think of Appsee Mobile App Analytics as a tour guide that take you on visual user journey and points out those things that are of greatest importance. That’s really what Appsee is all about, and why you should strongly consider having your own copy.

Lucidchart

Lucidchart is an online, drag and drop cloud-based sketching, diagramming, and wireframing application for designing websites, tablets or phones. Its large, comprehensive library of modern design elements and shapes enables you to build anything from a wireframe or mockup, to share information or build a mind map that will guide you through a complex project.

Lucidchart provides an excellent solution for your flowcharting exercises as well. Among the many useful features are the master page and keyboard shortcut capabilities which, when put to use, save you the trouble of having to repeat past work.

Pidoco

It should not come as a surprise to find Pidoco on this list of top UX/UI tools since it is the prototyping tool of choice for web designers in 50 different countries. Pidoco is an extremely easy to use web app with which you can create beautiful wireframes or fully interactive UX prototypes.

You have a selection of over 400 icons and UI elements to work with, and design features that include click and touch interactions, drag and drop image upload, screen transitions and page linking, and live browser and mobile review capabilities. Prototyping doesn’t get much easier.

PowerMockup

If you are a dedicated, or even a casual, PowerPoint user, PowerMockup is just the right solution for your prototyping needs. To create a wireframe for example, all you need to do is select the appropriate icons and shapes that reside in the PowerMockup library, and drag and drop them onto PowerPoint slides.

You then have a PowerPoint slideshow you can use to present your animated, interactive prototype. You can even add your own shapes and icons to PowerMockup’s ever-growing library, and share them with others.

Notism

Project collaboration is what Notism Collaboration does best, and it does this better than all the other tools of the same type. If you regularly work on projects where communication between interested parties is vital, this is a tool you should not be without. It can be invaluable to have at your disposal when you are working large, complex projects or with large teams.

Notism Collaboration also fills a vital need for smaller projects in which solid communications and feedback is critical to success. Everything is shared via real-time video presentations.

Loop11

Loop11 belongs in your toolbox if you’ve been looking to complement your design tools with a fully dedicated usability testing tool. There are few if any tools of this type that can give you usable design feedback quicker, when you are performing UX usability testing on your app or website designs.

Loop11 can work with up to 999 test subjects at a time while collecting clickstreams, heatmaps, and path analysis data. This tools findings are presented to you in a continuous feedback loop. You no longer have to avoid important usability testing out of fear it may be too complicated, or involve too much work.

UseItBetter

Forms Analytics by UseItBetter focuses on a small feature of your web product, yet a feature, that if faulty, can create problems for your users, and even turn more than a few of them off.

What this tool does is allows you to investigate problems associated with forms and form fields. If you have ever tried to fill out an online form, and encountered problems while doing so, eventually giving up the task and leaving the site, the problem you had is what Forms Analytics addresses. If forms are important UX elements to your website or business, you should keep this tool handy.

Patternry

Patternry is the ultimate tool for storing your design information, including everything from patterns and style guides to design elements and building blocks you anticipate to have a future need for.

Needless to say, the ability to save and reuse valuable design information can save you a huge amount of time, plus it makes it easier to share your design efforts and ideas with others. Patternry is a productivity tool with a difference. It will help you to avoid a ton of repetitious work.

Ending thoughts

Whether your need is for a solid prototyping tool, one with superior collaboration features, or one that has the usability testing capability you are looking for, you’ll find it here.

In this list we already have several specialty tools, usability testing tools, an online library for saving and reusing design work, and a diagramming tool that can do much more than create flowcharts. Whichever tool or tools you choose, you are in good hands.

15 Best Font Pairing Tools for Designers

hongkiat.com - di, 19/04/2016 - 17:01

Pairing fonts is an essential process of any web design. If you want to create a good website design, you need to be able to make decisions such as choosing the right font, color scheme, even the right WordPress theme. For those seeking fonts, web typography tools are their go-to source. But for regular laypersons like us, maybe there is another easier way to attempt this seemingly impossible task.

Of course, there are a variety of font combinations readily available on the web which you can use. However, it’s also important to know how to create your own font pairs. There’s a whole science to applying heading, subheading and body copy to fit the type of content you produce and your brand identity.

To help you with this process, here are 15 of the best font-pairing websites which will help you to find your perfect font combination. These websites are extremely easy to use and wil help you make ideal typography decision in a few seconds. Let us know which ones you have used or if there are any you would like to suggest.

Type Connection

Type Connection calls itself ‘a typographic dating game’. It will help you to learn how to pair typefaces. Begin with choosing a main type to find a perfect pair. Just like on a real dating site, Type Connection will suggest you potential ‘dates’ for each font you choose.

Google Type

There are over 650 free typefaces available in Google Fonts. This creative project offers inspiration for using fonts from the Google Fonts library.

Font Pair

Font Pair helps designers to combine Google Fonts. Just choose what kind of typeface pair you need between sans-serif, serif and cursive fonts. It also has a collection of font pairs in action.

Type Genius

Type Genius is a free tool to find the perfect font for your website or design project. You choose a starter font and find the best possible pair for it. As a result, the website shows the example where these two fonts are used.

Type Wolf

Type Wolf is a collection of beautiful font combinations from around the web. There, you’ll find the most popular fonts, the site of the day and various font recommendations to find your ideal match.

Beautiful Web Type

Google web font directory accounts for over 600 fonts. Of course, most of them are not really nice, but there are also high-quality typefaces which deserve a closer look. Here you can see these fonts in action. Just scroll down the site and see for yourself.

Fonts in Use

Fonts in Use is a collection of different designs, such as websites, packaging, branding, business cards, posters, magazines along with a list of fonts which were used.

Just My Type

Just My Type is a showcase of font pairings from Typekit and H&FJ. These font samples are displayed in nice colorful blocks.

Typ.io

All the fonts on Typ.io are tagged with related words and will help you to pair even complementary fonts together. It also features examples of different fonts used on websites, and you can see these combinations and pick the one you like.

Blender

This tool would be a perfect choice for bloggers. It can help you to pair fonts on heading, subheading and text copy. Using the bar on the left to choose the font family, size and line height.

Font Combinator

Font Combinator is a tool similar to Blender. It will also help you pair titles and text copy fonts. Just choose the element, font, size and color.

Font Combinator by Typotheque

Typotheque is both a graphic design studio and a type foundry publishing and distributing original Latin and non-Latin fonts. Their Font Combinator will help you to pair Latin, Greek, and Cyrillic fonts.

Adobe Typekit

Typekit is a subscription font tool which brings together various fonts for quick and easy search and pairing. Along with a free plan with limited collection of fonts, you may choose one of the paid plans that bear more options.

Matcherator

Matcherator by Fontspring will help you to define what font is used on the image. You can download an image from your computer, or use a URL of the image and a tool that will find the exact font (or similar), so you can use it in your design.

Typespiration

Typespiration is an amazing site featuring designer-contributed examples of sample text from their designs. Below each sample you’ll find a list of fonts which were used, color combinations, and even CSS code which you can paste into your website.

How to Change The Location of Your Dropbox Folder

hongkiat.com - di, 19/04/2016 - 15:01

Dropbox is one of the best ways to share files, large or small, in big numbers to multiple recipients. Many of us take the setup procedure for Dropbox for granted because it has been made so easy for us to start sharing almost immediately. Some of you may have even tried moving the location of the Dropbox folder outside of the C drive after installation. Didn’t work, didn’t it?

The location of the Dropbox folder cannot be manually moved by drag and drop. Dropbox will look for the folder at its previous location and sync the folder back there. You also cannot rename the Dropbox folder manually because this will cause syncing problems.

Here’s how you relocate your Dropbox folder to another drive.

(Step 1) Click on the Dropbox icon in system tray or in menu bar for OS X.

(Step 2) Click on the gear icon and select Preferences from drop-down menu. You will land on the Dropbox Preferences page.

(Step 3) Click on the Account tab and then click on the Move… button.

(Step 4) Specify the new destination address of Dropbox folder and click OK.

(Step 5) Click on OK to confirm the move.

Moving Dropbox folders to an External Drive

Note: If you want to move the Dropbox folder to an external drive rather than an internal hard drive, keep in mind that the Dropbox folder should be available before the Dropbox Desktop application starts. Some hard drives take time to get ready for sending or receiving data.

If the Dropbox folder is not available on time, you will get an error and Dropbox will ask you to relink the Dropbox account or exit if it is not able to find the Dropbox folder.

Sass Best Practices: Tips And Tools For Developers

hongkiat.com - ma, 18/04/2016 - 17:01

Much like how jQuery revolutionized vanilla JavaScript, Sass has revolutionized vanilla CSS. Most developers who learn Sass agree that they’d never want to go back. Many also agree that the biggest problem with new developers is the way they use Sass, not Sass itself.

I’ve scoured the web and compiled this article of best practices for writing expandable and reusable Sass code. Suggestions are from my own opinions and from trusted websites like Sass Guidelines.

You certainly don’t need to implement all of these features into your workflow. But it’s worth to at least entertain these ideas and contemplate the potential benefits.

File Organization

The best place to start with Sass development is file organization. If you’re already into modular code then you should understand the value of imports and partials (more on these later).

But for now just take a look at this file structure example from DoCSSa. I’ve recreated this file structure which you can see below:

This is just a suggestion and it’s one of the many ways you could organize your files. You can find other methods that use different folder structures like “globals” for site-wide SCSS and “pages” for page-specific SCSS.

Let’s walk through this suggested organization style to examine the purpose of each folder:

  • /globals – contains Sass files that get applied site-wide like typography, colors, and grids
  • /components – contains Sass files with component styles like buttons, tables, or input fields
  • /sections – contains Sass files dedicated to specific pages or areas on a page (might work better combined into the /components/ folder)
  • /utils – contains third-party utilities like Normalize that can be updated dynamically with tools like Bower.
  • main.scss – the primary Sass file in the root folder that imports all others.

This is just a basic starting point and there’s plenty of room to expand with your own ideas.

But no matter how you choose to organize your SCSS, it’s crucial that you have some organization with a separate file (or folder) for libraries like Normalize that need to be updated, plus components in Sass partials for your project.

Sass partials are vital to modern best practices. These are highly recommended by Zurb’s design team and by many other professional frontend developers.

Here’s a quote from the Sass website explaining partials:

“You can create partial Sass files that contain little snippets of CSS that you can include in other Sass files. This is a great way to modularize your CSS and help keep things easier to maintain. A partial is simply a Sass file named with a leading underscore. You might name it something like _partial.scss. The underscore lets Sass know that the file is only a partial file and that it should not be generated into a CSS file. Sass partials are used with the @import directive.”

Also take a look at these other posts regarding Sass file structure:

Import Strategies

Not enough can be said about the value of Sass import and partials. Code organization is key to getting an import structure and workflow that just works.

The best place to start is with a globals sheet containing imports, variables and mixins together. Many developers prefer to separate variables and mixins but this comes down to semantics.

Keep in mind that mixins are a way of importing, or rather duplicating, Sass code. They’re incredibly powerful but shouldn’t be used with “static” code. Keep in mind there’s a difference between mixins, extends, and placeholders, all of which have their use in Sass development.

Mixins are best used with dynamic values passed into the mixin for code alterations. For example, check out this Sass mixin that creates a background gradient between two colors.

@mixin linearGradient($top, $bottom){ background: $top; /* Old browsers */ background: -moz-linear-gradient(top, $top 0%, $bottom 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, $top 0%,$bottom 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, $top 0%,$bottom 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, $top 0%,$bottom 100%); /* IE10+ */ background: linear-gradient(to bottom, $top 0%,$bottom 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#000000',GradientType=0 ); /* IE6-9 */ }

The mixin takes two values: a top color and a bottom color. You could write different mixins for different types of gradients that include 3 or 4+ different colors. This allows you to import and clone the mixin code while changing the parameters for custom options.

The example from Code Responsible looks like this:

.button{ @include linearGradient(#cccccc, #666666); }

Related to the mixin is Sass’ placeholder which is primarily useful with the extend directive. It’s admittedly more complex than mixins, but this can be a way to combine selectors together without rewriting excess code.

While Sass has only one @import method, I’ve included mixins and placeholders to demonstrate the flexibility of code that can be written in one file but included anywhere.

When building an import structure just remember to follow the concepts of DRY coding (Don’t Repeat Yourself).

Naming Conventions

General rules for naming conventions apply to variables, functions, and mixins. When naming anything in Sass it’s recommended to use all lowercase letters with dashes for separation.

Sass code syntax is actually based on the CSS guidelines ruleset. Here are some recommended best practices to keep in mind:

  • two (2) spaces indents, no tabs
  • ideally, 80-characters wide lines or less
  • meaningful use of whitespace
  • use comments to explain CSS operations

These are not required items for valid Sass code. But these suggestions come from professional developers who have found these rulesets provide the most uniform coding experience.

But in regards to naming conventions you may end up with two different structures: one for Sass names and another for CSS class names. Some developers prefer BEM over Sass suggestions. Neither one is more, or less, correct; just different with different operating procedures.

The problem is that BEM doesn’t carry over well to Sass variables or mixins because they don’t have the block/element/modifier(BEM) structure. I personally prefer to use Sass naming conventions but you could try anything from camelCase to your own internal syntax.

When organizing your variables and mixins it’s recommended to split them up by category, then list them in alphabetical order. This makes editing a whole lot easier because you know exactly where to find something.

For example, to change a link color you’d open your variables file (maybe _variables.scss) and locate the section for color variables. Then find the link by name (header link, text link, etc) and update the color. Simple!

To get an idea of how you might structure a table of contents for your Sass files check out Foundation’s settings file.

// Foundation for Sites Settings // ----------------------------- // // Table of Contents: // // 1. Global // 2. Breakpoints // 3. The Grid // 4. Base Typography // 5. Typography Helpers ... // 1. Global // --------- $global-font-size: 100%; $global-width: rem-calc(1200); $global-lineheight: 1.5; // etc

Another naming practice pertains to responsive breakpoints. When naming Sass breakpoints, try to avoid device-specific names. It’s better to write names like small, med, lg, and xlg because they’re relative to each other.

This is better for internal relationships between breakpoints, but also great for teams where developers may not know which devices relate to each other.

As for actually putting down names, it’s recommended that you be as specific as possible without extra-lengthy variables. You should adopt site-wide naming conventions that are easy to remember while coding.

Give specific naming conventions for everything like colors, margins, font stacks and line-heights. Not only can the names be quickly recalled, but it makes your job easier when writing new variable names that need to match an existing syntax.

But there’s a fine line between specificity and convolution. Practice will help you find that line, and writing more memorable names makes it easier to copy code into other projects.

Nesting And Looping

These two Sass techniques are very different in action, yet both have the ability to be abused if not used considerately.

Nesting is the process of adding selectors nested together through indentation to create more specificity with less code. Sass has a nesting guide which illustrates examples of code nesting in action. But it’s easy to get carried away with nesting. If you’re overzealous you can end up with code that looks like this:

body div.content div.container { ... } body div.content div.container div.articles { ... } body div.content div.container div.articles > div.post { ... }

Far too specific and almost impossible to overwrite, this type of code defeats the purpose of cascading stylesheets.

Skimming this SitePoint guide you’ll find three golden rules for nesting:

  • Never go more than 3 levels deep.
  • Ensure the CSS output is clean and reusable.
  • Use nesting when it makes sense, not as a default option.

Developer Josh Broton suggests nesting when necessary, indent the rest as a general syntax rule.

Indenting your selectors will not cause any cascading CSS effects. But you’ll have an easier time skimming your Sass file pinpointing which classes relate to one another.

Loops can also be overused if not applied properly. The three Sass loops are @for, @while, and @each. I won’t go into detail about how they all work but if you’re interested check out this post.

Instead I’d like to cover the purpose for using loops and how they function in Sass. These should be used to save time writing code that can be automated. For example, here’s a code snippet from the Clubmate post showing some Sass code followed by the output:

/* Sass code */ @for $i from 1 through 8 { $width: percentage(1 / $i) .col-#{$i} { width: $width; } } /* output */ .col-1 {width: 100%;} .col-2 {width: 50%;} .col-3 {width: 33.333%;} .col-4 {width: 25%;} .col-5 {width: 20%;} .col-6 {width: 16.666%;} .col-7 {width: 14.285%;} .col-8 {width: 12.5%;}

These column classes can be used in conjunction with a grid system. You could even add more columns or remove some just by editing the loop code.

Loops should not be used to duplicate selectors or properties for a selector; that’s what mixins are for.

Also when looping there’s something called Sass maps that store key:value pairs of data. Advanced users should take advantage of these whenever possible.

But regular Sass loops are simple and effective at providing code output without repetition. The best reason for using loops is with CSS properties that vary data output.

Here’s a good way to check if your loop is helpful: ask yourself if there’s any other way to output the CSS you need with fewer lines of code. If not then the loop syntax is probably a great idea.

If you’re ever confused or want feedback about nesting or Sass loops you should post a question in either /r/sass/ or /r/css/, active Reddit communities with very knowledgeable Sass developers.

Modularization

The practice of writing modular Sass is an absolute necessity for most projects (I’d argue, every project). Modularization is the process of breaking down a project into smaller modules. This can be accomplished in Sass using partials.

The idea behind modular Sass is to write individual SCSS files with a specific purpose targeting global content(typography, grids) or page elements(tabs, forms).

The Sass module definition is pretty clear and makes a very specific suggestion: importing a module should never output code.

The idea of mandatory output for all modules would be a nightmare for optimization. Instead you should create modules individually and only call the ones you need. Modules can be defined by mixins or functions, but it is possible to create modules that contain selectors as well.

However a Sass Way article suggests writing all selectors as mixins and only calling them as needed. Whether you adopt this or not is ultimately your choice. I think it depends on the size of the project and your comfort with handling mixins.

Quoting John Long from his post on The Sass Way:

“For me, modules have become the basic units or building blocks of my Sass projects.”

If you’re really looking for a Sass routine I recommend going fully modular. Try building almost everything as a modular partial that gets included into a primary CSS file. At first this workflow can seem daunting but it makes sense on a grander scale – especially with big projects.

Plus it’s much easier to copy modules from one project to another when they’re located in separate files. Flexibility and reusable code are the cornerstones of modular development.

To learn more about Sass modules and modularization techniques check out these posts:

Find Your Perfect Workflow

Each team and individual developer has their own practices that work best. You should adopt practices that work best for you personally, or choose to adopt the ones that work best for your team professionally.

Also consider using Gulp or Grunt for project automation and minifying your code. This will save a lot of manual labor and automation tools are now undoubtedly part of the best practices for modern frontend development.

Skim through open source libraries like Foundation’s SCSS on GitHub to learn more about best practices employed by other libraries.

The thing about best practices is that they really improve your work most of the time, but there are many alternatives. Just try things and see how they feel. You’ll always be learning so your best practices may change rapidly over the course of 5 years.

One final suggestion I have for the entire Sass process is to make decisions with clarity in mind. Write code that makes your job easier. Don’t over-complicate a project if there’s a simpler way to do it.

Sass is meant to enhance the CSS development experience, so work with clarity and best practices to get the best experience possible.

Wrap-Up

Congestion in a Sass workflow can be corrected by tweaking code styles and following best practices. I’ve outlined a handful of suggestions in this post given from Sass blogs and professional developers.

The best way to learn more is to apply these practices into your workflow and see what works. Over time you’ll find that some activities are more beneficial than others, in which case you should keep whatever works and drop what doesn’t.

Check out these links to find more tips and best practices for Sass development:

How to Use YouTube PiP Mode in Chrome Browser

hongkiat.com - ma, 18/04/2016 - 15:01

YouTube Picture-in-Picture (PiP) mode allows users to watch videos in a small window by the corner, while browsing through other videos on YouTube. We are already using this feature on the Android & iOS YouTube apps.

However, by default, we cannot use this feature on the YouTube web version unless of course, you know the right plugin to install. We will be discussing how to enable your Chrome browser to watch YouTube videos in PiP mode with the help of a plugin called YouTube Picture in Picture.

(Step 1) Install Chrome YouTube Picture in Picture extension.

(Step 2) Once the extension is installed, go to YouTube on your browser.

(Step 3) Search and click on any video you want to watch

(Step 4) If you search for any other video while one is playing, the playing video will smoothly move to the bottom right corner in a much smaller window.

(Step 5) If you hover the cursor over the smaller video, you will see three options above the video.

  • The leftmost option will allow you to watch videos in normal mode rather than PiP.
  • The middle option will let you expand or shrink the video on the screen.
  • The rightmost option will close the video.

Note: If you have opened multiple tabs, the video in PiP mode will be visible inside the YouTube tab only and once the tab/browser is closed, the video will also be closed.

Bonus

You can also browse through YouTube in PiP mode using Sideplayer.

(Step 1) Install Chrome Sideplayer extension.

(Step 2) After the installation, go to YouTube on Chrome and search for any video you want to watch.

(Step 3) Locate and click on the Play in Sideplayer Option inside the video frame. The video will start at the top right corner of your browser in a separate YouTube player window.

Alternatively, click on the Sideplayer button in the main Chrome toolbar and paste the URL of the YouTube video you want to play in Sideplayer.

  • You can drag and adjust the size of the video window from the corner.
  • You can also drag and move the video anywhere inside the browser space.
  • Hover over the playing video to see the option to close it.

Unlike YouTube Picture in Picture extension, Sideplayer does not move a video automatically to the corner while you browse through YouTube. The video played in Sideplayer will also remain visible when we switch from one tab to another tab or even when we close the tab YouTube is opened on. It will only close when the browser itself is closed.

10 CSS and JavaScript Linting Tools for Code Optimization

hongkiat.com - vr, 15/04/2016 - 17:01

Linting tools can significantly help developers to write good quality, optimized code. Linting is a code-checking process that looks for errors in the source code, and flags potential bugs. Most linters use the static code analysis technique, which means the code is checked without being actually executed.

You can lint on different occassions, such as in real time while you write the code, when you save the file, when you commit the changes, or before the code goes into production. Whatever your workflow is like, the important thing is to lint on a regular basis, as it can save you from many headaches in the future.

Linters are not solely bug prevention tools, but they can also be effectively used during debugging to find errors that are hard to catch otherwise. In this post we will check out 10 powerful linting tools you can use to lint your CSS and JavaScript files in order to improve the quality of your code.

1. CSSLint

CSSLint admittedly intends to "hurt your feelings", but in exchange it "makes you code much better". CSSLint currently leads the market of CSS linting. It’s written in JavaScript, it’s open-source, and comes with tons of configurable options.

CSSLint allows you to choose what kind of errors and warnings (compatibility, performance, duplication, etc.) you want to test for, and validates your CSS syntax against the rules you opt for.

It doesn’t only work in the browser, but also has a command line interface, and you can integrate it into your own build system as well.

2. SublimeLinter CSSLint

CSSLint is such an effective CSS linter that it’s hard to find a competitor that measures up to it. Probably that’s the reason why the SublimeLinter linting framework built its CSS linting plugin on top of it. SublimeLinter is a SublimeText plugin that provides users with a means to lint their code (CSS, PHP, Python, Java, Ruby, etc.) right inside the SublimeText editor.

Before you install the SublimeLinter CSSLint plugin itself, you need to install CSSLint as a Node.js module. The great thing about this handy tool is that you only have to configure the settings once, or if you’re happy with the defaults you don’t even have to do that, then you can always get the relevant warnings and notifications inside your SublimeText editor without any further hassle.

3. StyleLint

StyleLint helps developers avoid errors in CSS, SCSS, or any other syntaxes that PostCSS can parse. StyleLint tests for over a hundred rules, and you can choose which ones you want to switch on (see an example config).

If you don’t want to build your own configuration, you can also opt for a pre-written, standard config that contains about 60 StyleLint rules. StyleLint is a quite flexible tool, it can be extended by extra plugins, and used in 3 different forms: as a command line tool, as a Node.js module, or as a PostCSS plugin.

4. W3C CSS Validator

Although W3C’s CSS Validator is usually not thought of as a linting tool, it gives developers a great opportunity to check their CSS source code against W3C’s official standards. W3C built its validators with the intent to provide a tool that’s similar to the Lint program checker for the C language.

At first, they created the HTML markup validator that was later followed by the CSS validator. W3C’s CSS validator doesn’t have as many options as CSSLint, but it returns detailed, easy-to-understand error messages and notifications.

As an extra feature, you can also check your code against W3C’s recent mobile web standards, which is not a bad thing in the era of the mobile web.

5. Dirty Markup

Dirty Markup cleans, formats, and validates your HTML, CSS, and JavaScript code. It can be a great choice if you like straightforward design and want a quick solution. Dirty Markup throws error messages and notifications in real time while you write or modify your code inside the editor.

When you hit the “Clean” button, it fixes syntax errors at once, tidies up the format, but leaves the warnings intact letting you solve them however you want. You can’t choose which rules you want to test for, but all three file types have a few settings that enable you to decide the format of the cleaned output.

6. JSLint

JSLint was first released in 2002 by Douglas Crockford, and haven’t lost momentum since then, so you can safely assume that it’s a stabile and reliable JavaScript linting tool.

JSLint can process JavaScript source code and JSON text, and it comes with a ready-made configuration that follows the JS best practices Crockford wrote about in his book entitled JavaScript: The Good Parts.

JSLint has a few options you can choose from, but you can’t add your own custom rules, or disable most of the features. JSLint has already begun to include the latest ECMAScript 6 standards, you can check out the current stage of the ES6 implementation here.

7. JSHint

JSHint is a highly popular fork of JSLint, and it’s used by major tech companies like Facebook, Twitter, and Medium

JSHint is a community-driven project that started out with the endeavour to create a more configurable and less opinionated version of JSLint. JSHint allows developers to configure any of its linting options, and place the customized configuration into a separate file, an option that makes the tool easily reusable, and a good fit for bigger projects.

You not only can use JSHint to lint vanilla JavaScript, it also has out-of-the-box support for many popular JS libraries, such as jQuery, Mootools, Mocha, and Node.js.

8. ESLint

ESLint is the latest big thing on the JavaScript linting landscape. Its popularity stems from its highly flexible nature. You not only can customize tons of its sophisticated linting rules, and integrate it with all major code editors, but you can also easily extend its functionalities by adding different plugins to it.

By specifying the parser options, you can also choose which standard of the JS language you want to support during the linting process, which means you not only can check your scripts against the default ECMAScript 5 syntax, but also against ECMAScript 6, ECMAScript 7, and JSX.

9. JSCS

JSCS, or JavaScript Code Style is a pluggable code style linter for JavaScript, that checks for code formatting rules.

The goal of JSCS is to provide a means to programmatically enforce adherence to a certain coding style guide. Although JSCS doesn’t check bugs and errors, it’s still used by many major players in the tech industry, such as Google, AirBnB, and AngularJS, as it helps developers keep a highly readable, consistent code base.

JSCS is a real time-saver, as it automatically fixes your formatting errors, so you don’t have to go through them one by one. It has many different presets belonging to bigger projects, such as Google, Grunt, or Wikimedia coding style presets, that you can easily use in your own projects, but you can also create your own custom configuration.

10. StandardJS

StandardJS, or JavaScript Standard Style is a code style linter just like JSCS, but differs from it in its simplicity and straightforwardness. StandardJS can be an excellent choice, if you don’t want to spend time with configuration, just want an effective tool that runs out of the box.

StandardJS follows a handful of pre-written formatting rules, and its core value is to keep your coding workflow distraction-free, so you can’t change the rules you disagree with. Only choose StandardJS if you don’t want to have a custom config, and just want to enforce a consistent code style across your JavaScript files.

Pagina's