Javascript News

Syndicate content
Pipes Output
Updated: 48 weeks 6 days ago

First Look at Yahoo’s MySQL Performance Analyzer

Fr, 2015-09-04 16:00

When you deploy an app to production servers, you may experience some database problems as your data grows. Some tools can help you debug and solve your problems, like MysqlTuner, Percona, etc. In this article, we’re going to explore the Yahoo MySql performance analyzer and see what the main features are.

Installation

The analyzer uses SNMP when available, so it’s a good idea to have it installed on your database server.

Because this is a JAVA application, make sure you have JDK installed before proceeding. It requires version 8 to run, but version 7 is fine since it doesn’t use any of version 8’s features. You can read more in the readme file in the repo.

I have a demo application on my Vagrant box, and I will install the analyzer in the root of my application. Let’s start by logging into our machine using ssh and cloning the repository.

vagrant ssh git clone git@github.com:yahoo/mysql_perf_analyzer.git myperf

To build the application, you need to run the mvn clean package command. After the build process is done, you’ll find a myperfserver-server.zip file under the perfJettyServer/target directory. Move that file to a new directory on your server and extract it. The resulting output contains start_myperf.sh and stop_myperf.sh scripts to manage the server. Let’s use the start script to launch the application. You can read more about the available options in the repo.

Managing Users

After starting the server, open your browser using your machine hostname and the specified port (vaprobash.dev:9092/myperf). You can log in with the default admin account (username: myperf, password: change).

Continue reading %First Look at Yahoo’s MySQL Performance Analyzer%

Ultimate Comparison of Email Tracking Tools

Fr, 2015-09-04 15:51

  Once upon a time, clicking “Send” was the end of the line. There was nothing left for the emailer to do but sit back and wait around for a reply. Now, clicking “Send” is just the beginning. Over the past few years, the market for email tracking software has exploded, and for companies that […]

Continue reading %Ultimate Comparison of Email Tracking Tools%

Getting Started with Programming the Intel Edison

Fr, 2015-09-04 15:00

After my brief introduction to the Intel Edison it’s time to get more familar with the platform’s software aspects.

I’m going to show how you can start to develop and deploy your ideas, how you can read/write from sensors/actuators and how you can communicate with the Cloud. Giving you what you need to start tinkering and hacking IoT devices.

Continue reading %Getting Started with Programming the Intel Edison%

Tips for Creating Accessible eLearning Resources

Fr, 2015-09-04 14:00

Did you know that in France, people with a disability are given free admission to the famous art gallery, the Louvre.

While online content is rarely as mesmerising as the Mona Lisa, many government departments are now required to provide accessible online content to internal staff and the public.

But what does that really mean?

Accessible online content should be available and understandable to anyone—regardless of physical, visual, auditory or mental impairment, or language proficiency.

The reported percentages of users with disability only marginally differ across the globe. The Australian Bureau of Statistics (ABS) records that 1 in 5 people reported that they had a disability. In the USA this figure is 12.1 per cent, and in the UK almost 1 in 5 people (19%) have a disability.

Convert those percentages into people and we are talking about literally millions of users.

But how many of these disabilities affect your department's staff when using a computer to do a task like accounts receivable? Or how many people in your public audience need a screen reader to use a claims portal?

Even if the answer turned out to be one out of 10,000, that person has as much right as anyone else to learn how to use the software/services being offered.

While this article will be useful for developers, I particularly want to talk to the 'project stakeholders' – the people who drive these projects – about what to think about when contracting someone to design and build your eLearning course.

Firstly, What Do We Mean by 'eLearning'?

eLearning is simply the delivery of learning content on a computer/tablet/smartphone via a series of screens or ‘slides’— viewable at any time rather than scheduled in a classroom. Some eLearning has embedded short video clips (eg person speaking, or screen recording of an application), interactive activities such as entering words into sentences and can also include assessment like multiple choice quizzes that provide instant feedback.

Organisations commonly use eLearning for training because it is available at any time and can be delivered to hundreds and thousands of people.

Many universities offer eLearning for some course units. eLearning can get funky too, with competitive game elements such as the Till Training Game designed for McDonalds employees (by City and Guilds Kineo).

The Cost of Accessible eLearning

Let's not dance around it: Accessible eLearning takes longer to design and develop and therefore costs more. The higher the accessibility level you seek, the more time and effort it is to achieve a 'pass'.

Invariably extra time will be required to:

  • run each page through an accessibility checker (such as the WAVE tool shown below)
  • test with a screen reader,
  • write effective transcripts for video,
  • write useful and detailed ALT attributes for charts and,
  • include file size descriptions for downloads.

While there is some level of automation available, to accurately test accessibility compliance, manual checking is mandatory. How much longer accessible eLearning design and development takes depends on your eLearning provider: experienced vendors will already well-established processes in place staffed with trained personnel already familiar with the success criteria and even perhaps reusable framework elements already designed for accessibility. This is a big advantage.

Converting non-accessible eLearning into accessible eLearning

Unfortunately there is no magic 'one-click' button for converting existing eLearning content into accessible eLearning content — especially if the original output is Flash-based (as is often the case).

The 'conversion' time depends on factors such as base code, level of interactivity, presence of audio and video. Sure, there are definitely some quick wins, like providing ALT attributes to images, but if you have five-minute long videos with audio and animation, you have some work to do.

There are many other potential access issues to consider. For instance:

  • Does the content rely on drag and drop interactions?
  • Is important and relevant content text embedded within images?

The truth is, often it may be more efficient to rebuild the course from the ground up using different eLearning authoring software and techniques than trying to retro-fit accessibility into older course materials.

Continue reading %Tips for Creating Accessible eLearning Resources%

Adapting RethinkDB For The Evented Web With Pusher

Fr, 2015-09-04 14:00

RethinkDB recently released version 2.0, and here at Pusher we're all very excited about how creating real-time apps can now be even easier. Changefeeds, a feature introduced by RethinkDB a few versions ago, allows your system to listen to changes in your database. This new version has significantly improved, opening up interesting possibilities for real-time applications.

While RethinkDB covers listening to events on your server, there is still the issue of publishing these changes to your client, who can build anything from news feeds to data visualizations.

This is where a hosted message broker such as Pusher comes into play. By exposing RethinkDB changefeed changes as Pusher events, you can quickly achieve scalable last-mile delivery that instantly pushes database updates to the client. Not only that, but Pusher's evented publish-subscribe approach fits the logic of real-time applications:

  • Channels identify the data, whether that's a table in a database or, in the case of RethinkDB, a changefeed.
  • Events represent what's happening to the data: new data available, existing data being updated or data being deleted.

As an added bonus, real-time features can be rolled into production fast, in the knowledge that Pusher will scale to millions of concurrent devices and connections, removing the pain of managing your own real-time infrastructure.

To show you how this can be done, this post will guide you through how to create the type of activity streams found on the RethinkDB website. By creating a small Sinatra app, we'll quickly build the JSON feed and high-scores list you can see in our demo. Note that while we are using Ruby and Sinatra, one of the great things about RethinkDB's adapters is how similar they are across all languages. In other words, what we do here can easily be applied to the stack of your choice.

Continue reading %Adapting RethinkDB For The Evented Web With Pusher%

How SitePoint Uses Slack

Fr, 2015-09-04 03:45

Everyone in the entire world loves Slack, obviously.

The increasingly ubiquitous chat app has taken over the business and media world, with organizations as diverse as eBay, Sony, Yelp, the New York Times and SitePoint (who?) hooked into the plaid-patterned platform. Slack has been valued at about US $2.8 billion, which is a lot of moneybag emojis but probably only one rocket ship emoji.

It’s interesting how different organizations have adapted Slack for their own purposes. What sorts of social conventions have they developed? What kinds of integrations have they integrated? What ridiculous emoji have they created? Once you start reading about this stuff, it can become quite addictive, as every new tidbit is something that may save you a bunch of time.

A few weeks ago we outlined how 6 organizations use Slack, which gave a bunch of practical ideas. I’ve also been publishing regular snippets of amusing conversations from our Slack channels to our Medium publication. But now, let’s move past the quips and puns and take a look at how we use Slack to make working life easier/better.

Dev Integrations

Like any other web company, our devs use Slack to centralize notifications from various other services, including GitHub, BuildBot, and AirBrake. Unlike some other organizations, Slack is mainly used to provide awareness, rather than acting as a place to deploy code or run services.

Where’s Wally?

Like most organizations who care about the sanity of their employees, we’re keen on letting people work from home whenever they like if that’s what works for them. The only potential wrinkle in that policy is when other, at-work people, who are organizing meetings and such, aren’t aware that their compatriots are away. To try to combat this, we’ve set up a channel where work-from-home-ers can check in to update people on their movements, so people’s expectations for replies etc are catered to.

Continue reading %How SitePoint Uses Slack%

Vorlon.js: Focus on DOM Explorer

Fr, 2015-09-04 01:10

In April 2015, our team of engineers and tech evangelists at Microsoft released vorlon.js - an open source, extensible, platform-agnostic tool for remotely debugging and testing your JavaScript. This article is the first in a series that will take a detailed look at one specific feature, starting with one of the biggest: the DOM Explorer.

Overview

If you’re not familiar with vorlon.js, I recommend first reading this blog post, which explains why we made vorlon.js and how to use it. You’ll find additional vorlon.js information at the end of this article.

The DOM inspector shows you the DOM of the remote webpage. You can inspect the DOM, clicking on nodes will highlight them in the host webpage, and if you select one you can also view and modify its CSS properties.

Installing Vorlon.js

Just as a reminder, here is what you have to do to use Vorlon.js:

  • Install and run the Vorlon.JS server from npm: $ npm i -g vorlon $ vorlon
  • Once Vorlon.js is done installing, you can now run the server: $ vorlon The Vorlon server is running
  • With the server is running, open http://localhost:1337 in your browser to see the Vorlon.js dashboard.
  • The last step is to enable Vorlon.js by adding this script tag to your app:
<script src="http://localhost:1337/vorlon.js"></script>

Now when you open your app you should see your client appear on the dashboard.

Using the DOM Explorer

By default, the DOM explorer is on but if you need to enable it, you have to go to [Vorlon folder]\Server\config.json and enable the plugin:

{ "useSSL": false, "includeSocketIO": true, "activateAuth": false, "username": "", "password": "", "plugins": [ { "id": "DOM", "name": "Dom Explorer", "panel": "top", "foldername": "domExplorer", "enabled": true } ] }

Once enabled you will be able to control almost everything related to the DOM through plugin’s main window.

Continue reading %Vorlon.js: Focus on DOM Explorer%

Introduction to Stage.js

Do, 2015-09-03 20:00

Stage.js is a lightweight and open-source JavaScript library that you can use for cross-platform 2D HTML5 game development. This library uses DOM-like model to manipulate the canvas and manages the rendering cycles of your application all by itself.
In this tutorial, I’ll introduce you to this library, trying to cover everything you may need to know how to start using it with ease.
Let’s start!

Setup and usage

Firstly, you have to download the library. You can get the latest version of Stage.js from its GitHub repository (here are included a few examples to get you started). If you prefer, you can also load it directly from a CDN. After including the core file, you have to add your own JavaScript file but be careful to not include your application files before the library.

Continue reading %Introduction to Stage.js%

Social Sharing WordPress Plugins Optimized for Mobile

Do, 2015-09-03 19:00

Did you know that the majority of internet users are browsing through websites on their mobile devices?

If you're a website owner go to your Google Analytics account and see for yourself. It may not be the majority in your case but I bet at least 30% of your visitors are looking at your website from their smartphones or tablets.

Even Google realized the importance of mobile browsing and because of that have updated its algorithm, earlier this year, to show “Mobile friendly’ websites higher in rankings than websites not optimized for mobile devices.

Assuming that you are a WordPress user, there is a big probability that your website is already optimized for the perfect mobile experience and that’s awesome.

But what about social sharing buttons on your website?

If your social sharing icons are not optimized for mobile devices you are missing out a huge deal here. Your job as a website owner is to give the best experience possible to your visitors, and that includes the ability to share your content on various social channels as easy as possible.

Today I am going the show you what some of the best WordPress plugins are which you can use to provide a perfect social sharing experience for both desktop and mobile users on your website.

Continue reading %Social Sharing WordPress Plugins Optimized for Mobile%

Watch: Mysteries of Eigenclasses in Ruby

Do, 2015-09-03 17:30

Eigenclasses (or singleton classes) are probably one of the most mysterious parts of the Ruby object model. Some beginner programmers think that working with eigenclasses is like performing a magic ritual, I admit I used to think the same way however it appears that eigenclasses are not as difficult as they seem. Moreover, understanding them is crucial to fully understanding Ruby object model and so in this video we will try to reveal the mystery of eigenclasses.

Click play if you are brave!

This is the second video of Ruby Metaprogramming Revealed series.

Loading the player...

Continue reading %Watch: Mysteries of Eigenclasses in Ruby%

PHP Summer Camp 2015 Review

Do, 2015-09-03 16:00

You’re standing on a long pier, the last ten meters of which curiously belong to international waters despite being well inside the current country’s territory. As you climb the meter-high rock wall that forms a small barrier towards the west, you’re able to witness the sun dipping into the sea, far in the distance. Soft waves caress the rocky surface below your feet, bobbing the sea urchins and fish to and fro. There are other people there, each immersed in their own thoughts.

No, that’s not a Dungeons and Dragons session starting. It’s the end of a great conference of workshops in Rovinj, Croatia, in the same spirit as last year’s.

PHP Summer Camp 2015

PHP Summer Camp is a dual event comprising of two PHP tracks and one eZ Publish track, the workshops of which are collectively called EZ Summer Camp. This year’s event took place slightly earlier than last year’s - from August 26th to 29th.

I attended in an entirely unofficial capacity this year. With zero responsibility on site, it was quite a different experience. This year’s key takeaways from the conference itself are:

  • Doctrine is less complicated than it seems, just awkwardly documented
  • Blackfire is less complicated than it seems, just awkwardly documented
  • More people need to read Ross Tuck’s guide to conference speaking
  • Puli is either the next game changer or the next big flop
  • If you’re only attending conferences you get invited to (and your schedule is not packed with those invites), you’re not a good member of the community
  • Tech people can and do have fun and interesting conversations in bars without getting drunk and awkward, contrary to popular belief.

Continue reading %PHP Summer Camp 2015 Review%

Does the New Google Logo Really Look Like Comic Sans?

Do, 2015-09-03 02:42

Google doesn’t change it’s brand often, but when it does, it’s hard to ignore it. From search pages, to app icons, to browser tabs, it is a brand that is stitched into the linings of our online lives.

Yesterday the ‘Big G’ rolled out probably their biggest re-branding effort ever. Here it is.

[caption id="attachment_114089" align="aligncenter" width="669"] “I Shot the Serif”— Google moves to a geometric sans-serif typeface.[/caption]

As you can see, the new logotype retains Google’s trademark colorful letterforms, but is now rendered in a sharper, slightly heavier san-serif typeface.

The color theme is pulled through to their square logomark too — the familiar white lowercase ‘g’ on blue back, is replaced with a new uppercase ‘G’ diagonally segmented into colored pieces.

That multi-colored ‘G’ seems more ‘googley’ to me than the white and blue 'g'.

Designers Alex Cook, Jonathan Jarvis, & Jonathan Lee talked about their week-long design sprint on the Google Design Blog.

To me, the update to a sans-serif typeface seems to make more sense. Their former serif font — particularly that ‘reading-spectacles g’ — always had an older, bookish feel of romance novels and Bronte sisters. The new geometric sans-serif is much more of a happy engineer’s construction.

But What Does 'The Internets' Think?

Sifting through the press, Twitter and Facebook, there seemed to be two distinct streams of reaction:

1). Designers by-and-large like it

Connie Birdsall, Creative Director, for Lippincott said “Google’s new logo is elegantly simple but still maintains the fun and playful quality of the original design.

It’s really about much more than a logo and more about kind of a smart system” says Geoff Cook, founding partner at Base Design.

SitePoint’s own Design & UX writer Laura Elizabeth tweeted: “Yay I LOVE @google’s new logo. Lovely stuff

Wired called it “.. simpler, younger, and friendlier”.

But it’s not all ringing endorsements.

2). Many non-designers are wringing their hands.

Professional grump, Jon Gruber groaned: "Their old logo was goofy. This new one is simply garbage. Just right for a company with no taste".

Public comments on the Official Google Blog include:

  • Went from a nice professional looking logo to a basic noring(sic) 1st grade font and you like it?
  • Yeuch…. not an improvement at all
  • Make that 2. The new favicon STINKS!. Hard to find on favorites bar

Another tweet by @desusnice insistedGoogle’s new logo is getting us closer to their eventual transition to comic sans”.

So… We know some people don’t like change.

Just not your type?

It’s interesting that many complaints portray the update as more unprofessional and childish than the previous incarnation.

[caption id="attachment_114098" align="alignright" width="273"] 'Google' in Harmonia Sans.[/caption]

Although the Google design team tells us the ‘new logotype is set in a custom, geometric sans-serif typeface’, the letterforms closely echo a handful of very well-established typefaces, including Harmonia Sans (check that capital 'G'), Twentieth Century and perhaps the godfather of geometric fonts, Futura.

Here’s a visual comparison of the new logotype with classic Futura.

[caption id="attachment_114091" align="aligncenter" width="666"] The new logo overlayed with classic Futura.[/caption]

As you can see, there are some minor differences — that jaunty twist to the ‘e’ being an obvious one — but the major characteristics are all there.

Continue reading %Does the New Google Logo Really Look Like Comic Sans?%

Browser Trends September 2015: IE’s Demise Edges Closer

Mi, 2015-09-02 22:00

In August, Chrome exceeded one in every two users for the first time. Can it keep up the pace in September's StatCounter statistics? …

Worldwide Desktop & Tablet Browser Statistics, July to August 2015

The following table shows browser usage movements during the past month.

Browser July August change relative IE (all) 17.18% 15.99% -1.19% -6.90% IE11 10.84% 9.94% -0.90% -8.30% IE10 1.73% 1.66% -0.07% -4.00% IE9 1.95% 1.83% -0.12% -6.20% IE6/7/8 2.66% 2.56% -0.10% -3.80% Edge 0.05% 0.74% +0.69% +1,380.00% Chrome 51.89% 52.97% +1.08% +2.10% Firefox 15.68% 15.60% -0.08% -0.50% Safari 4.20% 3.77% -0.43% -10.20% iPad Safari 5.54% 5.53% -0.01% -0.20% Opera 1.81% 1.79% -0.02% -1.10% Others 3.65% 3.61% -0.04% -1.10%

Continue reading %Browser Trends September 2015: IE’s Demise Edges Closer%

Measuring JavaScript Functions’ Performance

Mi, 2015-09-02 20:00

Performance has always played a crucial part in software. On the web, performance is even more important as our users can easily change website and visit one of our competitors if we offer them slow pages. As professional web developers, we have to take this issue into account. A lot of old web performance optimization best practices, such as minimizing requests, using a CDN and not writing rendering blocking code, still apply today. However, as more and more web apps are using JavaScript, it’s important to verify that our code is fast.

Suppose that you have a working function but you suspect it’s not as fast as it could be, and you have a plan to improve it. How do you prove this assumption? What’s the best practice for testing the performance of JavaScript functions today? Generally, the best way to achieve this task is to use the built-in performance.now() function and measure the time before and after your function executes.

In this article we’ll discuss how to measure code execution time and techniques to avoid some common pitfalls.

Performance.now()

The High Resolution Time API offers a function, named now() that returns a DOMHighResTimeStamp object. It's a floating point number that reflects the current time in milliseconds accurate to a thousandth of a millisecond. Individually, the number doesn’t add much value to your analysis, but a difference between two such numbers gives an accurate description of how much time has passed.

In addition to the fact that it is more accurate than the built-in Date object, it's also “monotonic”. That means, in simple terms, that it’s not affected by the system (e.g. your laptop OS) periodically correcting the system time. In even simpler terms, defining two instances of Date and calculating the difference isn’t representative of the time that has passed.

The mathematical definition of “monotonic” is (of a function or quantity) varying in such a way that it either never decreases or never increases.

Another way of explaining it, is by trying to imagine using it around the times of the year when the clocks go forward or go back. For example, when the clocks in your country all agree to skip an hour for the sake of maximizing daytime sunshine. If you were to make a Date instance before clocks go back an hour, and another Date instance afterwards, looking at the difference it would say something like “1 hour and 3 seconds and 123 milliseconds”. With two instances of performance.now() the difference would be “3 seconds 123 milliseconds and 456789 thousands of a millisecond”.

In this section, I won't cover this API in detail. So if you want to learn more about it and see some example of its use, I suggest you to read the article Discovering the High Resolution Time API.

Continue reading %Measuring JavaScript Functions’ Performance%

Color Alchemy with Less: Creating Color Schemes and Palettes

Mi, 2015-09-02 18:30

Color is one of the most important elements in any visual design. When properly used, it can have great impact on your web site or application. But knowing color theory solely is not enough to achieve such impact. You need to have the right tool belt to operate easily and successfully with the multitude of colors. Fortunately, Less solves this practical problem by providing plenty of color functions to work with.

In this tutorial, I’ll explore how to use some of these color functions, in conjunction with other Less features, to produce flexible and reusable mixins for color manipulation.

Creating Color Schemes

When attempting to create color schemes with Less, most people take the most obvious approach, which looks like this:

[code language="scss"]
@base-color: #00ff00;
@triad-secondary: spin(@base-color, 120);
@triad-tertiary: spin(@base-color, -120);
[/code]

This method uses variables and Less’s spin() function to create a color scheme (triadic, in our case). This works fine, but for me it’s not particularly reusable and not flexible enough. Fortunately, the issue can be resolved by using mixins. Let’s see what I mean.

[code language="scss"]
.analog(@color, @variant, @property) {
@first: spin(@color, 30);
@second: spin(@color, -30);
@list: @first, @second;
@return: extract(@list, @variant);
@{property}: @return;
}

.triad(@color, @variant, @property) {
@first: spin(@color, 120);
@second: spin(@color, -120);
@list: @first, @second;
@return: extract(@list, @variant);
@{property}: @return;
}

.quad(@color, @variant, @property) {
@first: spin(@color, 90);
@second: spin(@color, -90);
@third: spin(@color, 180);
@list: @first, @second, @third;
@return: extract(@list, @variant);
@{property}: @return;
}
[/code]

The above code creates three types of color schemes. I’ll explain only the last one, because the first two have the same structure and they don’t need individual explanations.

The .quad() mixin takes three parameters. The first one sets the base color for the scheme. The second one tells the mixin which color variant to return. And the third one defines which CSS property to use when Less compiles the code. Inside the mixin’s body, the spin() function creates the three available color variants in a quad scheme, then these variants are put in a list. The extract() function gets the desired variant, defined in the second parameter. And finally, with the help of variable interpolation, the color variant is assigned to the defined CSS property.

We can now put the above code in a separate file called color_schemes.less and use it as follows:

[code language="scss"]
@import "color_schemes.less";

@base-color: #00ff00;

div {
width: 200px;
height: 100px;
border: thick solid;
.quad(@base-color, 3, border-color);
.quad(@base-color, 2, color);
.quad(@base-color, 1, background-color);
}
[/code]

Here we import the file with the color schemes, and then we define the base color for our website or application. The last three lines in the div rule set, define the colors for the border-color, color, and background-color properties.

As you can see, the mixin can be used with any property whose expected value is a color. Besides, it’s super easy to see for which property a particular statement is used; just take a look at the end, and boom, we know it. For example, in the last statement you can clearly see that the first color variant of the quad scheme will be used as the value for the background-color property. Pretty cool, huh?

Continue reading %Color Alchemy with Less: Creating Color Schemes and Palettes%

Watch: Adding a Lap Logger to a React Stopwatch

Mi, 2015-09-02 17:30

Adding a lap-timer is no walk in the park, but what good is a stopwatch that only tracks one lap? We'll take all we've learned about state, lists, and conditional rendering to add this new feature. When we're done you'll be running laps of joy around your computer and timing them accurately.

This is part 3 of the Building a Stopwatch in React series.

Loading the player...

Continue reading %Watch: Adding a Lap Logger to a React Stopwatch%

Android Video Calling with CrossWalk and PeerJS

Mi, 2015-09-02 15:00

In this tutorial I'm going to show how to create a video calling app in Android. It will be implemented using Ionic, Cordova, Crosswalk and PeerJS.

Continue reading %Android Video Calling with CrossWalk and PeerJS%

5 Ways to Make Your Site Rock on the Modern Web (and Microsoft Edge)

Di, 2015-09-01 23:00

This article is part of a web development series from Microsoft. Thank you for supporting the partners who make SitePoint possible.

Edge is Microsoft's new web browser sporting a new rendering engine – EdgeHTML – and an underlying OS to boot in Windows 10. Since upgrades from Windows 7, 8 and 8.1 will be free for most, you can expect a huge influx of Edge users hitting sites in the coming months. Edge is a departure from the past, actually to complete rewrite from past versions of Internet Explorer and I’m sure many web devs will welcome that. With that in-mind, I wanted to share five ways in which you can prepare your site for modern web interoperability and also test for Microsoft Edge in parallel:

Update Your JavaScript Libraries

Common libraries like jQuery are often updated to address bugs when new browser versions are released. By simply updating your JS frameworks, you can avoid many compatibility bugs with Edge. In our internal research we found that 57% of the top 20,000 sites are using JavaScript frameworks that have issues that have been fixed in newer versions of the same library. You can use the site scanner to determine if you are using out of date JavaScript frameworks on your sites.

Avoid CSS Prefixes

CSS prefixes are used by browser vendors to implement new, emerging CSS features before they have been fully ratified by the W3C. If a vendor implements a CSS prefix, it will look something like the example below (this is an IE-specific implementation of the 'hyphens' feature to hyphenate text across multiple lines):

-ms-hyphens: auto;

It's really common for sites to have missing vendor-specific prefixes, or have implemented vendor-specific prefixes when they are not required in common CSS properties. This may cause a webpage to render incorrectly in Microsoft Edge or other modern browsers.

Browser vendors are using prefixes much less now because of the management problems associated with them. Some browsers, Microsoft Edge included, rarely if ever use prefixes at all.

Where possible, avoid the use of vendor-specific prefixes. However, if you absolutely must use vendor prefixes, use Grunt PostCSS to automate the management of prefixes within your CSS.

Continue reading %5 Ways to Make Your Site Rock on the Modern Web (and Microsoft Edge)%

Managing Huge Repositories with Git

Di, 2015-09-01 22:00

Linus Torvalds created Git in the mid 2000s to solve a problem that other open source version control systems at that time could not—to be distributed, reliable and fast.

As he mentions in this Google tech talk on Git, Git was created out of necessity for the Linux project. At the time the talk was given, Git was very young and people were getting used to it. It seemed to solve all the problems faced by version control software, and this contributed to its meteoric rise.

Git's Shortcomings

Fast forward a few years, and people started noticing the first real flaw in Git: it was difficult to handle very large repositories. How large are we talking here? It's Facebook large. Facebook's team projected that in a few years, a simple git status would take up to half a minute to show the result, as Facebook adds a large number of commits from thousands of developers every day. Facebook shifted its whole codebase to Mercurial, and its team actively started contributing to Mercurial to meet Facebook's needs.

Where did Git fail? A Mercurial contributor, Prasoon Shukla, on the comparison of scaling in Git and Mercurial, says that this can be attributed to the way Mercurial and Git store commits. Mercurial manages a couple of objects (or files) for each file in your repository, whereas Git creates an object for each commit. Therefore, on increasing the number of commits, the number of objects in Mercurial remains constant, in contrast to a linear increase in Git. Therefore, when you run a simple git status command, Git has to sift through all these objects, which takes a considerable amount of time (in spite of the high efficiency of Git).

Another area where Git might fall short is managing large binary files in the repository. Because Git tracks the changes in files, it's not able to interpret the content of binary files. And the size of the repository increases with every commit, because Git has to store the exact binary, rather than the change from the last version.

Over the years, developers of Git have tried to solve these problems. Each third-party service has come up with solutions to enable Git to manage larger repositories—such as GitHub's Large File Storage extension.

This post looks at techniques that can be used to handle large repositories in Git—in terms of large histories, as well as the presence of large binary files, or both.

Projects with a Large Number of Commits

I'll firstly look at a few ways to manage repositories with large histories more efficiently.

Shallow clone of repositories

As mentioned earlier, the primary reason why projects with large histories slow down is the huge number of commits. In a distributed system like Git, when you clone a repository, its full project history gets downloaded. However, Git provides a way to specify the number of commits you want to have in your clone of a project. This is known as a shallow clone. When you get the number of commits down, your Git operations run faster.

To perform shallow cloning, you need to add the --depth option, with the number of commits we want, to the clone command:

git clone --depth [number_of_commits] [url_of_remote]

In earlier versions of Git, there was limited support for shallow clones. If your truncated history didn't stretch long enough, you weren't allowed to push or pull. However, with the release of Git 1.9.0, support for shallow clones was increased significantly.

Clone a single branch

When you clone a repository, all the branches in the remote get downloaded. (If you run git branch in a newly cloned repository, it shows only the master branch. You should run git branch -a to list all the branches that were a part of the remote.) It's probable that many of the commits present in other branches are irrelevant to one developer's work. Therefore, you can clone just the master or the branch relevant to your development. Doing so significantly reduces the number of commits that make up the history of the cloned version, especially if branches in the repository have divergent histories.

To clone only a single branch of a remote, you can run the following command:

git clone [url_of_remote] --branch [branch_name] --single-branch

This command instructs Git to clone only the branch_name branch from the remote.

Continue reading %Managing Huge Repositories with Git%

This is What I Learned After Watching Videos for 48 Hours

Di, 2015-09-01 19:23

Hi, my name is Lauren, and I’m an addict. I’m addicted to two things: quotes and tools. Quotes because they inspire me and motivate me to keep pushing through during the hard times. Tools because I pride myself on being an early adopter, and, well, tools make my life more efficient and/or easier. Last weekend, […]

Continue reading %This is What I Learned After Watching Videos for 48 Hours%