emGee Software Solutions Custom Database Applications

Share this

Web Technologies

Auto-Sizing Columns in CSS Grid: `auto-fill` vs `auto-fit`

CSS-Tricks - Fri, 12/29/2017 - 06:40

One of the most powerful and convenient CSS Grid features is that, in addition to explicit column sizing, we have the option to repeat-to-fill columns in a Grid, and then auto-place items in them. More specifically, our ability to specify how many columns we want in the grid and then letting the browser handle the responsiveness of those columns for us, showing fewer columns on smaller viewport sizes, and more columns as the screen estate allows for more, without needing to write a single media query to dictate this responsive behavior.

We're able to do that using just one line of CSS — the one-liner that reminds me of when Dumbledore just waved his wand in Horace's apartment and "the furniture flew back to its original places; ornaments reformed in midair, feathers zoomed into their cushions; torn books repaired themselves as they landed upon their shelves...".

This magical, media-query-less responsiveness is achieved using the repeat() function and the auto placement keywords.

Much has been written about this particular one-liner, so I won't be elaborating on how it works. Tim Wright has a great writeup on this that I recommend reading.

To summarize, the repeat() function allows you to repeat columns as many times as needed. For example, if you're creating a 12-columns grid, you could write the following one-liner:

.grid { display: grid; /* define the number of grid columns */ grid-template-columns: repeat(12, 1fr); }

The 1fr is what tells the browser to distribute the space between the columns so that each column equally gets one fraction of that space. That is, they're all fluid, equal-width columns. And the grid will, in this example, always have 12 columns regardless of how wide it is. This, as you have probably guessed, is not good enough, as the content will be too squished on smaller viewports.

So we need to start by specifying a minimum width for the columns, making sure they don't get too narrow. We can do that using the minmax() function.

grid-template-columns: repeat( 12, minmax(250px, 1fr) );

But the way CSS Grid works, this will cause overflow in the row. The columns will not wrap into new rows if the viewport width is too narrow to fit them all with the new minimum width requirement, because we're explicitly telling the browser to repeat the columns 12 times per row.

To achieve wrapping, we can use the auto-fit or auto-fill keywords.

grid-template-columns: repeat( auto-fit, minmax(250px, 1fr) );

These keywords tell the browser to handle the column sizing and element wrapping for us, so that the elements will wrap into rows when the width is not large enough to fit them in without any overflow. The fraction unit we used also ensures that, in case the width allows for a fraction of a column to fit but not a full column, that space will instead be distributed over the column or columns that already fit, making sure we aren't left with any empty space at the end of the row.

At first glace of the names, it might seem like auto-fill and auto-fit are opposites. But in fact, the difference between is quite subtle.

Maybe it seems like you are getting extra space at the end of the column with auto-fit. But when and how?

Let's take a look at what is really happening under the hood.

Fill or Fit? What's the difference?

In a recent CSS workshop, I summarized the difference between auto-fill and auto-fit as follows:

auto-fill FILLS the row with as many columns as it can fit. So it creates implicit columns whenever a new column can fit, because it's trying to FILL the row with as many columns as it can. The newly added columns can and may be empty, but they will still occupy a designated space in the row.

auto-fit FITS the CURRENTLY AVAILABLE columns into the space by expanding them so that they take up any available space. The browser does that after FILLING that extra space with extra columns (as with auto-fill ) and then collapsing the empty ones.

This may sound confusing at first, but it makes a lot more sense when you visualize this behavior. So we'll be doing exactly that, with the Firefox DevTools' Grid Inspector helping us visualize the size and position of our Grid items and columns.

Consider the following demo as an example.

See the Pen auto-fill vs auto-fit by Sara Soueidan (@SaraSoueidan) on CodePen.

The columns are defined using the repeat() function and have a minimum width of 100px, and a maximum set to 1fr , so that they would expand and equally share any extra space when it is available. As for the number of columns per row, we're going to use the auto-placement keywords, so that we let the browser take care of the responsiveness of the grid and will wrap the columns into new rows when needed.

The browser will place and size the columns in the first example using the auto-fill keyword, and it will use auto-fit for the second.

.grid-container--fill { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } .grid-container--fit { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }

Up to a certain point, both auto-fill and auto-fit show identical results.

But they don't have identical behavior under the hood. It just so happens that they will give the same result up to a certain viewport width.

The point at which these two keywords start exhibiting different behaviors depends on the number and size of columns defined in grid-template-columns, so it will differ from one example to another.

The difference between these two keywords is made apparent when the viewport gets wide enough to fit one (or more) extra column(s) (that) into the row. At that point, the browser is presented with two ways to handle the situation, and how it handles it largely depends on whether or not there is content to be placed into that extra column.

So, when the row can fit a new column, the browser goes like:

  1. "I have some space to fit a new column in there. Do I have any content (i.e. grid items) to go into that extra column? Yes? OK, all good. I'll add the column into the row, and it will wrap into a new row on smaller viewports."
  2. In the case where there is no content to place into a new column: "Do I allow this new column to occupy space in the row (and, therefore, affect the position and size of the rest of the rows)? or do I collapse that column and use its space to expand the other columns?"

auto-fill and auto-fit provide the answer to that last question in particular, and dictate how the browser should handle this scenario. To collapse or not to collapse, that is the question. And that is also the answer.
Whether you want it to collapse or not depends on your content, and how you want that content to behave in the context of a responsive design.

Let's see how this works. To visualize the difference between auto-fill and auto-fit, take a look at the following screen recording. I'm resizing the viewport enough to create horizontal space that's enough to fit one (or more) column(s) into the row. Remember that these two rows are identical, and have the exact same of content and column number. The only difference in this demo is that I'm using auto-fill for the first one and auto-fit for the second.

Notice what is happening there? If it's still not clear, the following recording should make it clearer:

auto-fill behavior: "fill that row up! Add as many columns as you can. I don't care if they're empty — they should all still show up. If you have enough space to add a column, add it. I don't care if it's empty or not, it's still occupying space in the row as if it were filled (as in: filled with content/grid items)."

While auto-fill fills the row with as many columns as it can, even if those columns are empty, auto-fit behaves a little differently.
auto-fit does, too, fill the row with more columns are the viewport width increases, but the only difference is that the newly added columns (and any column gaps associated with them) are collapsed. The Grid inspector is a fantastic way to visualize this. You'll notice that columns are being added when you keep your eye on the Grid line numbers, which will increase as the viewport width increases.

auto-fit behavior: "make whatever columns you have fit into the available space. Expand them as much as you need to fit the row size. Empty columns must not occupy any space. Put that space to better use by expanding the filled (as in: filled with content/grid items) columns to fit the available row space."

A useful tip to remember here is that the columns added in both cases (whether collapsed or not) are not implicit columns — that has specific meaning in the spec. In our case, we are adding/creating columns in the explicit grid in the same way as if we declared you wanted 12 columns, for example. So column number -1 will work to target the end of this grid, which it doesn't if you are creating columns in the implicit grid. Props to Rachel Andrew for this tip.

Summing Up

The difference between auto-fill and auto-fit for sizing columns is only noticeable when the row is wide enough to fit more columns in it.

If you're using auto-fit, the content will stretch to fill the entire row width. Whereas with auto-fill, the browser will allow empty columns to occupy space in the row like their non-empty neighbors — they will be allocated a fraction of the space even if they have no grid items in them, thus affecting the size/width of the latter.

Which behavior you want or prefer is completely up to you. I have yet to think of a use case where auto-fill would make more sense than auto-fit. Do you have any use cases? If you do, please feel free to share them in the comments below.

Auto-Sizing Columns in CSS Grid: `auto-fill` vs `auto-fit` is a post from CSS-Tricks

Categories: Web Technologies

This Week in Data with Colin Charles 21: Looking Back on 2017 in the Open Source Database Community

Planet MySQL - Fri, 12/29/2017 - 04:33

Join Percona Chief Evangelist Colin Charles as he covers happenings, gives pointers and provides musings on the open source database community.

The end of the year is upon us, and this column is being penned a little earlier than usual as I enjoy a quick bout of wrapping up for the year.

We’ve had a lot of things happen in the database world. It’s clear that open source is everywhere, the cloud is large, and we’ve seen a lot of interesting movements in our MySQL world, from the standpoint of corporate contributions too. GitHub continues to enhance Orchestrator, and gh-ost keeps on getting better; Facebook has ensured MyRocks is now mainstream in both MariaDB Server and Percona Server for MySQL distributions; Alibaba Cloud and Tencent have been contributing to make MariaDB Server better.

We’ve seen the year end with MySQL 8.0 release candidate ready, as well as MariaDB Server 10.3 Beta. We had MariaDB Server 10.2 go GA in May 2017, and we’ve seen a steady stream of improvements in MySQL & Percona Server 5.7 releases.

Vitess I think is still a bigger deal than it’s made out to be. Slack talking about their use case at Percona Live Dublin was good. ProxySQL is a shining star for proxies.

We’ve seen some database vendors pass on — RethinkDB, with very promising technology, started in 2009, raised $12.2m, but finally ended up at Stripe with the code open and relicensed thanks to the Cloud Native Computing Foundation. We’ve seen Basho (makers of Riak), start in 2008, raised $61.2m, ended up at Bet365 and Riak is all open source now.

We’ve seen MongoDB IPO, MariaDB Corporation raise more money (some reported $98.2m in total), and more money still streams into the database world, like for BlazingDB in the GPU space and so on.

What do I look forward to in 2018? Oracle compatibility and PL/SQL in MariaDB Server 10.3 should be interesting. I’ve heard a lot of buzz around Apache Kafka. I expect we’ll see more manageability in MySQL. And also, fun to note that MMAPv1 in MongoDB has been deprecated before MyISAM in MySQL.

Right before the New Year, it is interesting to look at some proxy statistics of database usage, via the WordPress Statistics. Head down to the MySQL versions, and you’ll note that 5.5 gets 41.9% of users (this could be MySQL/Percona Server for MySQL or MariaDB Server), but you’ll also notice at a close second comes 5.6 at 39.8% of the users (this is only MySQL or Percona Server for MySQL). 5.7 gets 6.4% of the users as the 3rd most popular option, followed by 5.1 at 4.3% of users of WordPress (these folk desperately need to upgrade). 10.0 gets 1.6%, while 10.1 gets 3.8% (these are all MariaDB Server versions only). So the death of MySQL has greatly been exaggerated — people like it, people use it, and I can only imagine if more distributions ship 5.7 or 8.0, this could be a win for MySQL.

Releases Link List Upcoming appearances
  • FOSDEM 2018 – Brussels, Belgium – February 3-4 2018
  • SCALE16x – Pasadena, California, USA – March 8-11 2018
Feedback

I look forward to feedback/tips via e-mail at colin.charles@percona.com or on Twitter @bytebot.

 

Categories: Web Technologies

Easily Snapshot Test API Calls

Echo JS - Thu, 12/28/2017 - 15:34
Categories: Web Technologies

Monitoring Amazon Aurora with PMM

Planet MySQL - Thu, 12/28/2017 - 11:53

In this blog, we’ll look at how to monitor Amazon Aurora using Percona Monitoring and Management (PMM).

One impact of the growth of web services such as AWS on DBAs is the need to understand and report on database and application resource usage. DBAs have always had to monitor for performance-related usability issues, which may have led to investment in larger servers. However, services such as Aurora operate pricing models based on usage. Performance issues can be more closely attributed to rising costs, so badly performing systems more visibly affect the bottom line. DBA has become a cost center!

With that in mind, from Percona Monitoring and Management (PMM) 1.5 onwards, we delivered features that provide enhanced support for the performance monitoring of Amazon Aurora instances. “[Aurora] is a fully managed, MySQL- and PostgreSQL-compatible, relational database engine.” (Amazon docs).

Here’s a walkthrough of some of the key features in PMM that could benefit DBAs managing Aurora, and eliminate the need for additional monitoring nodes. The images here, pulled up from our demo system, display a seven-day overview of one of our test instances. You can focus tightly on the past five minutes or pan out to the last five years, depending on your analysis requirements.

Starting with this dashboard summary, which appears at the top of the screen, PMM displays an instant summary on the “health” of your instance.

Engine uptime and CPU Utilization are helpfully highlighted in green, reinforcing a healthy status. Amber or red alerts means pay attention to the instance and whether there have been issues in the recent past.

In this case, we can see that Aurora was last restarted 2.1 weeks ago.

The next three statistics in this section cover the current status of the instance at the time you loaded the dashboard. Aurora is using ~15% of the available CPU resources. Your application is asking approximately ~400 queries per second.There is  370MiB of unused RAM at the current time.

Aurora Costs

The next four graphs are closely aligned with running costs. In creating these graphs, PMM calls on Amazon’s CloudWatch service. This provides up to one million API calls per month as part of your service, without additional charge (December 2017). A refresh of these graphs uses 15 calls, and you can configure the refresh frequency.

Three of these graphs represent CPU Utilization, Network Traffic and Memory Usage. As a DBA you are likely to be familiar with these terms. PMM displays these as a metric series over time.

The fourth graph of CPU Credit Usage, top right, covers usage credit and applies specifically to Aurora MySQL db.t2.small and db.t2.medium instances. There are two parameters in play here. CPUCreditBalance represents the number of CPU credits accumulated during the specified time, allocated to the instance’s virtual CPU.  CPUCreditUsage represents the actual CPU used during the same period. In essence, the gap between the two indicates the capacity of the instance to operate beyond its baseline performance level at a given rate.

Our demo instance, which runs a synthetic workload based on sysbench, is showing a regular usage pattern and accumulating credit. It’s no surprise that we are not bursting our CPU requests. This pattern of use is less likely to apply to a real-life application.

By the way, clicking on any graph in PMM displays it in full screen, so we don’t restrict your view to a quadrant of the screen.

Aurora MySQL

Next up, there’s a set of four graphs representing MySQL specific metrics. These show information that’s important to DBAs as a matter of course. They take on more significance if you’re seeking opportunities to tune applications to minimise costs.

The Percona Database Performance blog has lots of blog posts that cover these metrics in more detail, and we may well revisit them in due course in the context of Aurora MySQL. For this review of PMM, it’s enough to say that each of these would have its place in tuning with a view to improving your overall efficiency.

Summary

Since charges for web services are based on usage, the role of the DBA is in the spotlight. You need to optimize usage, and PMM 1.5 can help you achieve that for Amazon Aurora thanks to these features:

  • Dedicated Aurora dashboard which offers maximum visibility into key database characteristics
  • Simple configuration of key Aurora settings via a web interface.
  • We renamed Amazon RDS OS Metrics to Amazon RDS / Amazon MySQL Metrics. This better reflects the Amazon Data Services that we support.

And did you know that beyond providing PMM, Percona has built a reputation for MySQL and now Amazon Aurora proficiency? We recently worked with Lookout to increase efficiency and more effectively use their Amazon Aurora deployment to save Lookout hundreds of thousands of dollars! If you think you could benefit from this kind of Amazon Aurora or other MySQL assistance, please contact us!

Categories: Web Technologies

Solving The “Widget Problem” In ADR - Paul M. Jones

Planet PHP - Thu, 12/28/2017 - 08:15

The “widget problem” is when you have several panels or content areas on an html page that have different data sources. You might have a main content area, then a calendar off to the side, with perhaps a list of recent news items or blog posts, a todo or reminder widget, and maybe other information panels. The problem is that they each have different data sources, and may not always be displayed in every circumstance — perhaps they are only shown to some users based on their preferences, or under certain conditions.

So how, in Action-Domain-Responder, do we get the “right” data for the set of widgets that are actually going to be displayed? (We’ll presume here that the entire page is being rendered server-side, for delivery as a whole to the client.)

The answer is “the same as with anything else” – we just have more kinds of data to get from the domain. The domain has all the data needed, and the knowledge necessary to figure out which data elements to return.

Let’s start with the Action, which is intentionally very spare: it only collects input, calls the Domain with that input, then invokes the Responder:

<?php class PageAction { public function __construct( PageService $domain, PageResponder $responder ) { $this->domain = $domain; $this->responder = $responder; } public function __invoke(HttpRequest $request) { $payload = $this->domain->fetchPageData( $request->getAttribute('pageName'), $request->getAttribute('sessionId') ); return $this->responder->respond($request, $payload); } }

The domain work is where the heavy lifting happens. The example below returns the domain objects and data wrapped in a Domain Payload object.

<?php class PageService { // presume $userService, $sessionService, and $database // dependencies are injected via constructor public function fetchPageData($sessionId, $pageName) { $session = $this->sessionService->resume($sessionId); $user = $this->userService->fetch($session->userId); // the main page data $mainData = $this->fetchMainData($pageName); if (! $mainData) { return new Payload('NOT_FOUND'); } // an array of widgets to show $widgets = []; // different users might prefer to see different widgets foreach ($user->getWidgetsToShow() as $widgetName) { $method = "fetch{$widgetName}Data"; $widgets[$widgetName] = $this->$method(); } $this->sessionService->commit($session); return new Payload('FOUND', [ 'user' => $user, 'page_name' => $pageName, 'main_data' => $mainData, 'widgets' => $widgets ]); } protected function fetchMainData($page_name) { return $this->database->fetchRow( "SELECT * FROM pages WHERE page_name = ? LIMIT 1", $page_name ); } protected function fetchTodoData() { ... } protected function fetchRemindersData() { ... } protected function fetchUpcomingEventsData() { ... } protected function fetchCalendarData() { ... } }

Finally, the Responder work becomes as straightforward as: “Is there Todo data to present? Then render the Todo widget via a Todo helper using the Todo data.” It could be as simple as this:

<?php class PageResponder { // ... public function respond(Request $request, Payload $payload) { if ($payload->getStatus() == 'NOT_FOUND') { return new Response(404); } $output = $payload->getOutput(); $html = ''; $html .= $this->renderHeader($output['page_name']; $html .= $this->renderNav(); $html .= $this->renderMain($output['main_data']); foreach ($output['widgets'] as $widgetName => $widgetData) { $method = "render{$widgetName}Html"; $html .= $this->$method($widgetData); } return new Response(200, $html); } protected function renderHeader($request, $pageName) { ... } protected function renderNav($request) { ... } protected function renderMain($request, $mainData) { ... } protected function renderTodoHtml($request, $widgetData) { ... } protected function renderRemindersHtml($request, $widgetData) { ... } protected function renderUpcomingEventsHtml($request, $widgetData) { ... } protected function renderCalendarHtml($request, $widgetData) { ... } ?>

One alternative here is for some client-side Javascript to make one additional call per widget or panel to retrieve widget-specific data, then render that data on the client. The server-side work becomes less complex (one action per widget, and transform the data to JSON instead of html) – but the client-side work becomes more complex, and you have more HTTP calls back-and-forth to build the page.

Categories: Web Technologies

Five Design Fears to Vanquish With CSS Grid

CSS-Tricks - Thu, 12/28/2017 - 05:58

CSS grid, along with a handful of other new CSS properties, are revolutionizing web design. Unfortunately, the industry hasn't embraced that revolution yet and a lot of it is centered around fear that we can trace back to problems with the current state of CSS grid tutorials.

The majority of them fall into one of two categories:

  1. Re-creating classic web design patterns. Grid is great at replicating classic web design patterns like card grids and "holy grail" pages.
  2. Playing around. Grid is also great for creating fun things like Monopoly boards or video game interfaces.

These types of tutorials are important for new technology. They're a starting point. Now is the time, as Jen Simmons says, to get out of our ruts. To do that, we must cast off our design fears.

Fear 1: Asymmetry

We've been trained in the era of frameworks that symmetric and orderly designs are better. It's true that for many applications a symmetric design or an orderly grid of items is preferred. Yet, asymmetry has the ability to capture the eye and mind in a way that symmetry never will. Asymmetry is interesting in its disorder. If you're nervous, you can always start small.

See the Pen Asymmetric Promo Grid by Bryan Robinson (@brob) on CodePen.

In this example, we have a simple promotional space. By using an asymmetric vertical and horizontal layout, we can make a stronger visual match between our icon and our button. This isn't a large space, but it's not afraid of using whitespace to draw the user's eye where we want it to go.

Speaking of whitespace...

Fear 2: Negative Space

As we left the early 2000s, we decided it was OK if users had to scroll. We began introducing whitespace into our designs and most of this fell between rows of content. This made our designs much cleaner, but is vertical whitespace the only valid option?

In this example, the design incorporates negative space to create a sense of exploration through the page. By not using traditional content rows, the user's eye is given a chance to scan and take things in at a slower pace.

See the Pen Experimental Homepage by Bryan Robinson (@brob) on CodePen.

Fear 3: Punk Rock?

There's no shortage of design talks focused on the print layouts of the 1970s. It was a time of great stability in design tooling, which allowed creativity to bloom. With that came inspired and avant-garde design work that centered around the punk-rock scene.

So my question is this: Can we be punk rockers in web design?

In this example, the design doesn't care about your preconceptions. Text overlap is a bug? Nope, it's a feature. Images shouldn't compete with each other? Survival of the fittest!

See the Pen Grid Overlap and Punk Rock Meditation by Bryan Robinson (@brob) on CodePen.

As this example asks, is this a good idea? It's completely up for debate. What I know is this: our tools have matured and become more stable; now is the time for experimentation. Do we want the web to look the same year after year, or do we want to dream up new and exciting patterns?

Fear 4: New Sources of Inspiration

Sources of inspiration shouldn't cause fear, but they do often cause headaches. Remember, inspiration doesn't mean a 1:1 translation of a concept.

Punk rock graphic design

I mentioned earlier the amazing designs that came out of the '70s and '80s. Here are some links to continue researching punk-rock design:

Vintage movie graphic design

Studying film in college gave me a great appreciation for vintage movie graphic design. One of my professors once told me: "You should be able to tell the tone and subject of a film by its title cards."

This is especially true of post-World War II films. Their title sequences and posters are a treasure trove of design ideas for setting a scene.

Learn how to create graphic design grids

Graphic designers have been using grids for layout for centuries, and there's a lot of great literature on the creation of these grids:

Fear 5: Fallbacks

It's true that Grid has only 74% support in the U.S. (at the time of this writing).

That should not stop you from pushing your designs forward. There are plenty of strategies for starting with support for all browsers and then pushing forward into new patterns.

What's next?

It falls to each of us to push our industry forward. The technology is in place to challenge ourselves to create new and interesting designs. This doesn't have to be as pointed and intense as some of these examples. It starts by realizing we can do amazing things … or we can stagnate.

How will you push the industry forward?

Five Design Fears to Vanquish With CSS Grid is a post from CSS-Tricks

Categories: Web Technologies

​Wix.com: Make the Web Your Playground

CSS-Tricks - Thu, 12/28/2017 - 05:57

(This is a sponsored post.)

Here's something you can do: kick off 2018 with your own professional website. The only thing you'll need to get started is your imagination, a little free time, and an innovative website builder.

Wix is the world's most technologically advanced website builder. Sign up for Wix, choose a template, and start customizing it. Whether you’re a novice, a business owner, a sophisticated designer, or a professional website builder, you’ll have full control of your website - from design prototyping to production.

Wix takes care of all the heavy lifting. You get reliable, safe, secure hosting that you'll never need to worry about. You get a custom domain name and email. To get started, all you need is a computer and a little time.

Don't underestimate what you can do with Wix. There are all kinds of advanced design features and functionality if that's something you need. The web is your playground. We’ve come along way from the website building platforms of the 90s. Now, you can create any kind of website you want and even collaborate with friends or coworkers.

Save yourself time and money, and head over to Wix.com to get started for free. Kick off 2018 strong with your own professional website and share your ideas with the world.

Direct Link to ArticlePermalink

​Wix.com: Make the Web Your Playground is a post from CSS-Tricks

Categories: Web Technologies

Front-End Tools: My Favorite Finds of 2017

CSS-Tricks - Thu, 12/28/2017 - 05:45

Another twelve months have passed and I'm sure all of you have come across some interesting new coding techniques, technologies, CSS tricks (of course!), and other stuff that will make you more productive in 2018.

As some of you might know, I curate a weekly newsletter called Web Tools Weekly, in which I feature dozens of links every week to new tools, mostly focusing on stuff that's useful for front-end developers. So it's an understatement to say that I've come across lots of new tools over the past 12 months.

As I've done in years past, I've put together a brief look at some of my favorite finds in front-end tools.

And please note that this is not a list of the "best" or "most popular" tools of 2017 – this has nothing to do with popularity or number of GitHub stars. These are tools I believe are unique, interesting, and practical – but not necessarily all that well-known. They are some of my personal favorite finds of the year, nothing more.

tlapse

When working on a new project, especially a large and lengthy one, it's easy to forget the number of changes the project's layout has gone through. tlapse is a command-line utility that allows you to set up automated screenshots of your work at specified intervals, essentially giving you a visual timeline of your development in the form of a series of screenshots.

The project has 1,100+ stars on GitHub, so it seems developers are finding a valid use for this, even though it seems a little narcissistic at first glance. Besides the novelty of being able to look back at the progress of your project, I suppose tlapse could also be used to send visual progress reports to clients, project managers, or other development team members.

You install tlapse as a global npm package:

npm install -g tlapse

Then run it in the background and start your work:

tlapse -- localhost:3000

By default, tlapse will take screenshots at one minute intervals and the screenshots will be added to the tlapse folder in the current project (i.e. where you execute the command):

Usefully, tlapse will also take a screenshot only if it detects the layout has changed in some way. So if the next scheduled screenshot is the same as the previous, it will skip it:

If you want to use a different directory or change the screenshot frequency, enter these as options along with the regular command:

tlapse --every 3m --directory ./screenshots -- localhost:3000

As the name suggests, tlapse allows you to make a time lapse video or animated GIF that demonstrates the progress of your work. Here's one I created while mock-building a Bootstrap-based layout:

Overall, this is an easy to use tool, even for those not very comfortable with the command line, and there are certainly some use cases for wanting to take screenshots of work in progress.

KUTE.js

JavaScript animation libraries are not rare. But KUTE.js caught my eye due to its main selling point: Performance. It can't be denied that if you're going to even consider complex animations in web apps today, you have to be prepared to deal with potential performance problems as a result of users accessing your app on mobile devices or on slower connections.

The moment you visit the KUTE.js home page, you're greeted with a colorful, complex, super-smooth animation, testifying to the truth of this tool's claims.

In addition to performance, two other things I like:

  • A really nice API
  • An excellent callback system

You start to build your animations by creating tween objects. For example:

var tween = KUTE.fromTo( '.box', {backgroundColor:'yellow'}, {backgroundColor:'orange'}, {complete: callback} );

The above example creates a fromTo() tween with various options. Inside fromTo() I've specified the selector for the target element, the start and end values for the property being animated, and a callback function to execute when the animation is complete.

You can also create tweens using to(), allTo(), and allFromTo(), with the latter methods letting you apply animations to collections of objects.

The callback functionality is very fine-grained, allowing you to run code (which could include calling a new animation altogether) at specified points, including:

  • When an animation starts
  • For each frame of the animation
  • When an animation is paused
  • When an animation is resumed after having been paused
  • When an animation is stopped
  • When an animation is completed

I've only scratched the surface of the features available. The documentation on the site is good, so check that out for the full API. The CodePen below is based on one of the demos from the API docs, which uses the .chain() method to chain multiple transform animations.

See the Pen Chain Transform Animations with KUTE.js by Louis Lazaris (@impressivewebs) on CodePen.

ScrollDir

Scrolling libraries have been popular for some time now. ScrollDir, from the developers at Dollar Shave Club, is a really simple, tiny, and intuitive utility to help you do a couple of simple things with scroll detection.

Once you drop in the library, in its simplest form the script just works. You don't need to call the scrollDir() method or anything like that. If you open your browser's developer tools and examine the live DOM while scrolling up and down on a page running ScrollDir, you can see what it does:

As shown in the above GIF, this utility adds a data-scrolldir attribute to the page's <html> element, which changes to one of two values, depending on scroll direction:

<!-- when the user is scrolling down --> <html data-scrolldir="down"> <!-- when the user is scrolling up --> <html data-scrolldir="up">

It defaults to "down" when the page hasn't yet been scrolled, although it seems like it could benefit from having a "neutral" class as a third optional state.

With this attribute in place, it's super easy to make custom changes to a page's layout with nothing but CSS, taking advantage of CSS's attribute selectors:

[data-scrolldir="down"] .header-banner { top: -100px; } [data-scrolldir="up"] .footer-banner { bottom: -100px; }

You can see the above code, combined with some simple CSS transitions, demonstrated in the CodePen below, which is similar to the example on the ScrollDir home page:

See the Pen ScrollDir basic demo by Louis Lazaris (@impressivewebs) on CodePen.

ScrollDir offers a few minor API options if you choose to use the non-auto version of the script. In either case it's dead simple to use and I'm sure will come in handy if you're building something that needs changes to occur on the page based on scroll direction.

CodeSandbox

Due to the popularity of web app development using libraries like React and Vue, a number of different IDEs and other code tools have come on the scene, aimed at helping developers who are working with a specific library or framework.

CodeSandbox is an online code editor for four of the current big players: React, Vue, Preact, and Svelte. This tool is somewhat in the same category as CodePen Projects, but is specifically designed for each of the four aforementioned libraries.

One of the nice features of CodeSandbox is the ability to add npm packages in the left side bar, under a pane called "Dependencies". There's a button called "Add Package" that allows you to search for packages in the npm registry:

And if your app is missing a dependency, CodeSandbox will indicate this with an error message and an option to add the required package. In the following GIF, I've pieced together this React calculator app as an example project in CodeSandbox:

Notice the project still had a missing dependency, which I was able to install instantly. Here's the CodeSandbox link to my version of that project.

Another feature that caught my eye is the ability to "peek" at the definition of a function in the code window:

Like many native IDEs, this allows you to be able to track down a function's source, for quicker debugging and whatnot. There are also some clean inline code completion features, just like a native IDE.

There are tons more features I haven't discussed here – including GitHub integration, deployment via ZEIT, and lots more – so be sure to poke around the different panels to get a feel for what you can do.

AmplitudeJS

AmplitudeJS is a dependency-free (we like that nowadays don't we?) HTML5 audio player "for the modern web". I think a lot of independent hobby-driven music makers with web development experience will appreciate this one for a number of reasons.

Amplitude allows you to build your own audio player with your own custom design and layout. To add a song list, you can add it via the main Amplitude.init() method in JSON format. Here's an example with three songs:

Amplitude.init({ songs: [ { name: "Song Name One", artist: "Artist Name", album: "Album Name", url: "/path/to/song.mp3", cover_art_url: "/path/to/artwork.jpg" }, { name: "Song Name Two", artist: "Artist Name Two", album: "Album Name Two", url: "/path/to/song.mp3", cover_art_url: "/path/to/artwork.jpg" }, { name: "Song Name Three", artist: "Artist Name Three", album: "Album Name Three", url: "/path/to/song.mp3", cover_art_url: "/path/to/artwork.jpg" } ] });

The code behind this player generates the audio using the Web Audio API, which is kind of like adding HTML5's audio element, but with nothing but JavaScript. So you could technically generate a functioning version of the AmplitudeJS player with zero HTML. See this CodePen as an example, which auto-plays the only song in the playlist and has no HTML. Even if you examine the generated DOM, there's nothing there; it's just JavaScript. In that instance, I'm using the "autoplay": true option in the init() method (the default is false, of course).

If you want to see the flexible and varied audio players that can be built with AmplitudeJS, be sure to check out the examples page. The Flat Black Player is probably my favorite for its similarity to an old-school MP3 player. I've put it into a CodePen demo below:

See the Pen LeEgyj by Louis Lazaris (@impressivewebs) on CodePen.

In terms of configuring AmplitudeJS, here are some of the highlights.

All the info you provide in the JSON can be added dynamically to the player wherever you want. For example the following HTML would display the song name, artist, album, and file URL for the currently playing track:

<p amplitude-song-info="name" amplitude-main-song-info="true"> <p amplitude-song-info="artist" amplitude-main-song-info="true"> <p amplitude-song-info="album" amplitude-main-song-info="true"> <p amplitude-song-info="url" amplitude-main-song-info="true">

Notice the amplitude-song-info attribute, which defines which bit of data you want to inject into that element. You wouldn't necessarily use paragraphs, but that's one way to do it. You can see this in action in this CodePen demo.

With the metadata features, adding a running time or time remaining indicator for the current song is easy:

<p class="amplitude-time-remaining" amplitude-main-time-remaining="true"> <p class="amplitude-current-time" amplitude-main-current-time="true">

Another great feature is the ability to work with callbacks (which is pretty much a must for any good API). Here's two of the callback options used in a simple example:

Amplitude.init({ songs: [ // songs list would be here... ], callbacks: { before_play: function() { document.querySelector('.msg').innerHTML = 'Song will now begin...'; }, after_stop: function() { document.querySelector('.msg').innerHTML = 'Song has ended!'; } } });

You can see this in action in this CodePen. I've incorporated a rudimentary play/pause button to help with the callbacks. To see the final callback, you have to wait for the song to complete (pausing doesn't trigger the after_stop callback). The button is built using nothing but a few HTML attributes, no extra scripting needed.

This is a really small sampling of what's possible with this player and how flexible it is. The docs are solid and should get you up and running with this tool in no time.

Honorable Mentions

That's a detailed look at five of my favorites from the past year. But there are lots of others worth examining that are similarly lesser-known. I've listed some of these below:

  • BunnyJS –An ES6-based front-end framework that advertises as "Simple like jQuery, better then jQuery UI, powerful like React".
  • keyframes-tool –A command line tool to convert CSS animations to a keyframes object suitable for use with the Web Animations API.
  • Konsul – A React renderer that renders to the browser's developer tools console.
  • across-tabs – Easy communication between cross-origin browser tabs.
  • svgi – A CLI tool to inspect the content of SVG files, providing information on the SVG (number of nodes, paths, containers, shapes, tree hierarchy, etc).
  • CSS in JS Playground – Play around with the code for just about any of the CSS-in-JavaScript solutions (JSS, styled-components, glamorous, etc).
What's Your Favorite Find of the Year?

So that's it. As I said at the start, this was not meant to be an awards ceremony for best tools of the year, but more of a look at some not-so-mainstream alternatives that are interesting and practical. I hope you find some of them useful. If you're interested in continuing to keep up with the influx of new tools in front-end development, be sure to subscribe to my newsletter.

Have you stumbled upon (or built) something cool over the past year that would be of interest to front-end developers? Let me know in the comments, I'd love to take a look.

Front-End Tools: My Favorite Finds of 2017 is a post from CSS-Tricks

Categories: Web Technologies

2017: The year in programming languages

InfoWorld JavaScript - Thu, 12/28/2017 - 03:00

For programming languages, languages like Java and Kotlin garnering a lot of attention in enterprise and mobile development in 2017. The JavaScript ecosystem, critical to web development, continued to expand as well.

Overall, the year presented a mixed bag of improvements to both long-established and newer languages.

Developers followed a soap opera over Java, with major disagreements over a modularization plan for standard Java and, in a surprising twist, Oracle washing its hands of the Java EE enterprise variant.

To read this article in full, please click here

Categories: Web Technologies

Our Most Popular Database Blog Posts in 2017

Planet MySQL - Thu, 12/28/2017 - 02:50

As we wrap up our last blog of 2017 we wanted to reflect on what content we have been creating that’s been resonating and generating the most interest with our readers. We will continue to deliver the best technical content we can for MySQL, Galera Cluster, PostgreSQL, MariaDB, and MongoDB in 2018.

Here is some of our most popular content from 2017…

Top Database Blogs for 2017 ClusterControl Single Console for Your Entire Database Infrastructure Find out what else is new in ClusterControl Install ClusterControl for FREE Top Blogs by Technology

While MySQL and MySQL Galera Cluster dominate our most popular content we blog about a lot of different technologies and methodologies on the Severalnines blog. Here are some of the most popular blogs in 2017 for non-MySQL topics.

If there are some blog topics you would like us to cover in 2018 please list them in the comments below.

Tags:  MySQL percona MariaDB MongoDB PostgreSQL blogs clustercontrol
Categories: Web Technologies

Async + Await [dotJS 2017]

Echo JS - Wed, 12/27/2017 - 18:28
Categories: Web Technologies

MariaDB Holiday Reflections and Gratitude

Planet MySQL - Wed, 12/27/2017 - 16:44
MariaDB Holiday Reflections and Gratitude MariaDB Team Wed, 12/27/2017 - 19:44

As we wrap up 2017, we want to take a moment to reflect on the past year. We’ve seen tremendous support from our community, customers and partners – and for that, we are grateful. Our customers across the global have shared heartwarming stories of their business success and we appreciate the opportunity to be your valued partner.

For us, 2017 was a milestone year. Our progress this year reflects a global theme that brings us forward to new opportunities.

  • Solutions to global problems: To make it easier for our customers to find solutions specific to their types of workloads, we introduced two complete solutions – MariaDB TX for transactional workloads and MariaDB AX for analytical workloads. The solutions are comprised of our technology products, as well as tools, services and support for an optimal production deployment environment. This year was also highlighted by the GA releases of MariaDB Server 10.2, MariaDB MaxScale 2.1, MariaDB ColumnStore 1.1.

  • Global event: In April, we held our first annual MariaDB global user conference M|17. Customer from as far away as Asia and Europe traveled to NYC to share success stories, best practices and technical deep dives from the MariaDB team.

  • Growing reach worldwide: This year, Debian followed the trend of Linux distributions replacing MySQL with MariaDB as the default. MariaDB reaches more than 60 million developers worldwide through its inclusion in every major Linux distribution, as well as a growing presence in the world’s major cloud providers.

  • Global team to support global customers: We’ve expanded our diverse team with employees in 20+ countries, plus Jon Bakke joined the leadership ranks as Chief Revenue Officer.

  • Investment from all corners of the world: Additional investment from Alibaba, the European Investment Bank and existing investors continue to fund global growth and product innovation.

We are excited to keep up the momentum in 2018, starting with our second annual MariaDB M|18 user conference in February. We look forward to seeing you in NYC!

Wishing you a happy new year from the team at MariaDB!
 

Happy New Year | Onnellista uutta vuotta | Feliz año nuevo 

Bonne année | Gott Nytt År | Felice Anno Nuovo

Frohes neues Jahr | С Новым годом | 新年快乐 | 良いお年を | 새해 복 많이 받으세요

 

As we wrap up 2017, we want to take a moment to reflect on the past year. We’ve seen tremendous support from our community, customers and partners – and for that, we are grateful. Our customers across the global have shared heartwarming stories of their business success and we appreciate the opportunity to be your valued partner. For us, 2017 was a milestone year. Our progress this year reflects a global theme that brings us forward to new opportunities.

Login or Register to post comments

Categories: Web Technologies

OSX and case-sensitive file system

Planet MySQL - Wed, 12/27/2017 - 14:11

I am really angry now.

A few weeks ago, when I was finished my MySQL backend checker I lost about two hours of work because I wasn’t commit anything to git, but I overwrote the working file with one of my doodle files – which file had the same name but with camel case. I had a default APFS filesystem (on High Sierra) – which is not case sensitive. This was a real amateur mistake I admit it, but the damage was done, I had to recreate everything (actually the second time I was way faster, it took around an hour.)

Anyways, I had to reinstall my computer anyhow, so when I get to the point to decide what kind of filesystem I want to use, I haughtily selected ‘CASE SENSITIVE’. “Yes, please give me a good, old-fashioned Linux-like case-sensitive file system.”

I did not use this laptop too much so far (this is a different story, maybe I’ll talk about it later), so it is still not too comfy but before we went to the in-laws I decided to install Steam on it, to bring a few games with me.

And Steam is not starting. It just launches, but don’t display the login form.

After a few minutes of googling it seems, Steam is not working with the case-sensitive file system under OSX and now I am contemplating about I should reinstall this laptop again. Not because of Steam, I can live without it – I do have a desktop PC so if I want to play a game, I can do it on that machine, but I am thinking if Steam is not working, maybe other software won’t work as well, and now it is way less uncomfortable to do this reinstall. Actually, the installer informed me about that, so owe the devil with this work.

But I am still angry about it.

 

Categories: Web Technologies

Pages