Wednesday, May 11, 2016

Sourcehunt: Emerging Tech Edition

Sourcehunt Logo

In October 2015, we introduced Sourcehunt in the PHP Channel. The goal of Sourcehunt here at SitePoint was to help open source projects find new contributors, while also helping contributors gain experience and street cred by getting involved in an open source project. With this same goal, we launched Sourcehunt on the Design channel 2 months later. In this article, we're bringing it to a whole new area that is growing here at SitePoint — emerging tech!

Synergy is the keyword here. Leaving a mark on an open source project can have a great impact on future projects. I've personally been very fortunate to volunteer and contribute to projects like Mozilla or Fedora. Contributing to these projects prepared me for other more demanding projects, which would pay my bills at the end of the day. If you are able to set a few hours aside to work on side projects like these, you will see the advantages in no time!

In this edition, we will be focusing on open source projects in the Emerging Tech sector. Specifically, 3 projects from the fields of virtual reality, the Internet of Things and augmented reality. We will present a short introduction to the project, how you can contribute and conclude each with the main programming languages and license used in each project. Ready? Let's dive in.

OSVR

OSVR is an open-source software platform for virtual and augmented reality. It allows discovery, configuration and operation of hundreds of VR/AR devices and peripherals. OSVR supports multiple game engines, and operating systems and provides services such as asynchronous time warp and direct mode in support of low-latency rendering.

The name says it — Open Source Virtual Reality. Pretty damn exciting for gamers and open source lovers alike! It is especially exciting as it's maintained by Razer, a gaming hardware manufacturer that is quite popular among gamers. Another maintainer of OSVR is Sensics.

The project is relatively complex, with a lot of development, discussions and tracking not happening in a central place. However, when looking for help, a way to contribute, or how to dive into development, the first place to check out is the OSVR GitHub repo. Check out the repo's issue list if you want to help out in any specific ways. They are neatly labelled for easy inspection:

GitHub OSVR Labels

The OSVR developer portal is the hub for getting involved in the project. To get started, check out the following:

If you want to work on your first bug, you should look out for the red "bug" labels and start working on them.

Bonus

OSVR Headset

If you have some spare funds, have a look at the OSVR HDK (Hacker Development Kit). It is fully open source, and the hardware schematics are free for anyone to download and tweak. If you want to go a step further, have a look.

Programming Languages & License

OSVR Languages

Over 69.3% of the code is written in C++, 21.4% in CMake and 4.4% C.

The code is licensed under the Apache 2.0 License. Check out my article explaining open source licenses as well, if you are interested to know more about that license.

Kaa

With the rise of the Internet of Things, concerns of security and privacy flaws have emerged as well. A certain project named Kaa aims to change that.

Kaa is a production-ready, multi-purpose middleware platform for building complete end-to-end IoT solutions, connected applications, and smart products. The Kaa platform provides an open, feature-rich toolkit for the IoT product development and thus dramatically reduces associated cost, risks, and time-to-market.

Kaa Features

Sounds promising, right? Kaa is completely open source and free (free as in freedom and free beer). It offers both community support and commercial support. In this article, we will focus on the community aspect and how you can get involved.

Continue reading %Sourcehunt: Emerging Tech Edition%


by Elio Qoshi via SitePoint

This Week's HTML5 and Browser Technology News (Issue 239)


Read this e-mail on the Web
HTML 5 Weekly
Issue 239 — May 11, 2016

We're going to rebrand HTML5 Weekly to a more 'front-end'-oriented name soon. No change in content, but 'front-end' better reflects what we're covering. If you have any opinions or suggestions, hit reply - we're reading :-)
- Peter Cooper, editor

Adam Silver
Write CSS without worrying that overzealous, pre-existing styles will cause problems.


Michaela Lehr
Learn how to add more functionality to your browser by creating your own bookmark manager Chrome extension using Angular 2 and TypeScript.


Serg Gospodarets
Two alternative ways to specify colors in CSS using the hex format. In Firefox Nightly now and coming to Chrome and WebKit very soon.


Daniel Stenberg
The creator of cURL reflects on the definition of a ‘URL’ and how it varies: “The WHATWG view of a URL is not widely adopted outside of browsers.”


Wijmo  Sponsored
To build the new mobile interface for its Dynamics CRM solution, Microsoft used the high-quality JavaScript controls in Wijmo 5, a collection of true JavaScript UI controls by GrapeCity. Read more about the top reasons Microsoft Dynamics chose Wijmo 5.

Wijmo

Jon Yablonski
Nowadays, we think a lot about smaller, mobile screens, but developers should consider the challenges and techniques to optimize for large-scale screens too.


W3C
A new editor’s draft is out today covering a popular spec that defines the rules for the use of WAI-ARIA accessibility attributes on HTML documents.


The Mozilla Blog
Mozilla has unveiled ‘Test Pilot’, a way for users to test experimental features in Firefox.


Michael Riethmuller
Unlike responsive typography, which changes only at set breakpoints, fluid typography resizes smoothly to match any device width.


Jobs

  • craigslist seeks JavaScript Developers (San Francisco, CA)CL seeks web devs with JavaScript, CSS, and HTML experience to join a small (~50), tech-driven, laid-back workplace to design and ship new features daily, and see them loved (or hated) by millions. Come help us save the world, or at least our corner of the Internet. craigslist
  • Job Offers. No resume necessary.Create your Hired profile to get top companies to start applying to hire you. Get offers from $75,000 - $250,000 on the platform in 1 week. Hired.com

In brief

Curated by Peter Cooper and published by Cooper Press.
Want to post a job? E-mail us or use our self-serve system.

Unsubscribe : Change email address : Read this issue on the Web

Published by Cooper Press Ltd. Office 30, Lincoln Way, Louth, LN11 0LS, UK


by via HTML5 Weekly

This Week in Mobile Web Development (#107)

Read this on the Web

Mobile Web Weekly May 11, 2016   #107
Chris Brandrick recommends
Embracing Fluid Typography — Unlike responsive typography, which changes only at set breakpoints, fluid typography resizes smoothly to match any device width.
Michael Riethmuller
Brian Rinaldi recommends
Service Workers and PWAs: It's About Reliable Performance, Not 'Offline' — Service Workers solve a web app reliability problem that AppCache was never designed to solve.
Alex Russell
Holly Schinsky recommends
How Web Developers Can Adapt to a Mobile App World — Insight into how other web developers and web development companies can adapt to an increasingly mobile world.
Paul Francis
Sponsored
How to Add Secure Authentication to iOS Apps [Video Tutorial] — Join Stormpath iOS Evangelist Edward Jiang for an on-demand authentication tutorial. You'll learn to implement token-based authentication with OAuth2, how to integrate social login using the Stormpath SDK, and find code samples to make it easy.
Stormpath

Holly Schinsky recommends
Mobile Site or App? With Progressive Web Apps You Can Get The Best of Both
Suzan Ryan
Brian Rinaldi recommends
Angular Mobile Toolkit — A tool for automatically creating progressive web apps using plugins for App Shell, Service Worker and Application Manifest.
Angular
Brian Rinaldi recommends
Making Sense of The Mobile Development Ecosystem: Hybrid Apps — Part 2 of my series laying out the mobile development ecosystem covers hybrid apps and hybrid/native apps.
Brian Rinaldi
Brian Rinaldi recommends
NativeScript 2.0 Released: Use JS for Cross Platform Native Apps — NativeScript 2.0 is out and has tight integration with Angular 2.0 for building native mobile apps with JavaScript and Web technologies.
NativeScript.org
Brian Rinaldi recommends
What Are The Key Differences Between React Native and NativeScript? — A detailed look at the technical and non-technical differences between these mobile frameworks from the perspective of the PM of NativeScript.
Quora
Holly Schinsky recommends
Opera's Ad-Blocker Goes Live For Both Desktop and Mobile Web Browsers — Opera’s built in ad-blocker has gone live for the Opera Mini browser for Android and their desktop browser.
Brad Linder
Brian Rinaldi recommends
EU Welcomes Agreement to Make Public Sector Sites and Apps More Accessible — The first EU-wide rules on making the websites and mobile apps of public sector bodies more accessible.
European Commission
Holly Schinsky recommends
10 Minutes with Ionic 2: Using the Camera with Ionic Native — Andrew McGivery shows how to use Ionic Native to interface with the Cordova Camera plugin.
The Official Ionic Blog
Sponsored
Convert existing websites to native Android & iOS apps, no changes required — Check our examples, or try it out for free!
GONATIVE.IO

Holly Schinsky recommends
Uploading Multiple Files At Once with Cordova — How to upload multiple files at once in your hybrid apps using the Cordova FileTransfer plugin.
Raymond Camden
Holly Schinsky recommends
Maintaining Separate Configs for Cordova Dev, Beta and Release Build Targets — Part 4 of a series on devops for Cordova dev’t. Subjects covered are continuous integration, beta testing, over-the-air-updates and maintaining separate configurations for each build target.
Ryan Salva
Holly Schinsky recommends
Building the F8 App with React Native — A series of tutorials designed to introduce React Native, written alongside the building of the F8 2016 app for Android and iOS.
Makeitopen.com
Brian Rinaldi recommends
Responsive Images with Jekyll — Basd on a JekyllConf presentation, shows how to implement responsive images with Jekyll and imgix.
Oliver Pattison
Job listing
Hired is the best place to find engineering jobs. — Bored at work? Want to try a new stack? Find 3500+ great tech companies on Hired who will compete to hire you. Try it today.
Hired.com

Curated by Brian Rinaldi and Holly Schinsky for Cooper Press.
Cooper Press is located at Office 30, Fairfield Enterprise Centre, Louth, LN11 0LS, UK
Update your email address
or stop receiving MWW here


by via Mobile Web Weekly

Introduction to Webpack: Part 2

In the previous tutorial we learned how to set up a Webpack project and how to use loaders to process our JavaScript. Where Webpack really shines, though, is in its ability to bundle other types of static assets such as CSS and images, and include them in our project only when they're required. Let's start by adding some styles to our page.

Style Loaders

First, create a normal CSS file in a styles directory. Call in main.css and add a style rule for the heading element.

So how do we get this stylesheet into our page? Well, like most things with Webpack, we'll need another loader. Two in fact: css-loader and style-loader. The first reads all the styles from our CSS files, whilst the other injects said styles into our HTML page. Install them like so:

Next, we tell Webpack how to use them. In webpack.config.js, we need to add another object to the loaders array. In it we want to add a test to match only CSS files as well as specify which loaders to use.

The interesting part of this code snippet is the 'style!css' line. Loaders are read from right to left, so this tells Webpack to first read the styles of any file ending in .css, and then inject those styles into our page.

Because we've updated our configuration file, we'll need to restart the development server for our changes to be picked up. Use ctrl+c to stop the server and webpack-dev-server to start it again.

All we need to do now is require our stylesheet from within our main.js file. We do this in the same way as we would any other JavaScript module:

Note how we haven't even touched index.html. Open up your browser to see the page with styled h2. Change the colour of the heading in your stylesheet to see it instantly update without a refresh. Lovely.

You've Got to Sass It

"But nobody uses CSS these days, Grandad! It's all about Sass". Of course it is. Luckily Webpack has a loader to do just the thing. Install it along with the node version of Sass using:

Then update webpack.config.js:

This is now saying that for any file ending with .scss, convert the Sass to plain CSS, read the styles from the CSS, and then insert the styles into the page. Remember to rename main.css to main.scss, and require the newly named file in instead. First some Sass:

Then main.js:

Super. It's as easy as that. No converting and saving files, or even watching folders. We just require in our Sass styles directly.

Images

"So images, loaders too I bet?" Of course! With images, we want to use the url-loader. This loader takes the relative URL of your image and updates the path so that it's correctly included in your file bundle. As per usual:

Now, let's try something different in our webpack.config.js. Add another entry to the loaders array in the usual manner, but this time we want the regular expression to match images with different file extensions:

Note the other difference here. We're not using the exclude key. Instead we're using include. This is more efficient as it is telling webpack to ignore everything that doesn't match a folder called "images".

Usually you'll be using some sort of templating system to create your HTML views, but we're going to keep it basic and create an image tag in JavaScript the old-fashioned way. First create an image element, set the required image to the src attribute, and then add the element to the page.

Head back to your browser to see your image appear before your very eyes!

Preloaders

Another task commonly carried out during development is linting. Linting is a way of looking out for potential errors in your code along with checking that you've followed certain coding conventions. Things you may want to look for are "Have I used a variable without declaring it first?" or "Have I forgotten a semicolon at the end of a line?" By enforcing these rules, we can weed out silly bugs early on.

A popular tool for linting is JSHint. This looks at our code and highlights potential errors we've made. JSHint can be run manually at the command line, but that quickly becomes a chore during development. Ideally we'd like it to run automatically every time we save a file. Our Webpack server is already watching out for changes, so yes, you guessed it—another loader.

Install the jshint-loader in the usual way:

Again we have to tell Webpack to use it by adding it to our webpack.config.js. However, this loader is slightly different. It's not actually transforming any code—it's just having a look. We also don't want all our heavier code-modifying loaders to run and fail just because we've forgotten a semicolon. This is where preloaders come in. A preloader is any loader we specify to run before our main tasks. They're added to our webpack.conf.js in a similar way to loaders.

Now our linting process runs and fails immediately if there's a problem detected. Before we restart our web server, we need to tell JSHint that we're using ES6, otherwise it will fail when it sees the const keyword we're using.

After the module key in our config, add another entry called "jshint" and a line to specify the version of JavaScript.

Save the file and restart webpack-dev-server. Running ok? Great. This means your code contains no errors. Let's introduce one by removing a semicolon from this line:

Again, save the file and look at the terminal. Now we get this:

Thanks, JSHint!

Getting Ready for Production

Now that we're happy our code is in shape and it does everything we want it to, we need to get it ready for the real world. One of the most common things to do when putting your code live is to minify it, concatenating all your files into one and then compressing that into the smallest file possible. Before we continue, take a look at your current bundle.js. It's readable, has lots of whitespace, and is 32kb in size.

"Wait! Don't tell me. Another loader, right?" Nope! On this rare occasion, we don't need a loader. Webpack has minification built right in. Once you're happy with your code, simply run this command:

The -p flag tells Webpack to get our code ready for production. As it generates the bundle, it optimises as much as it can. After running this command, open bundle.js and you'll see it's all been squashed together, and that even with such a small amount of code we've saved 10kb.

Summary

I hope that this two-part tutorial has given you enough confidence to use Webpack in your own projects. Remember, if there's something you want to do in your build process then it's very likely Webpack has a loader for it. All loaders are installed via npm, so have a look there to see if someone's already made what you need.

Have fun!


by Stuart Memo via Envato Tuts+ Code

Seven Handy SQL Scripts for SQL Developers

A lot of things that we do depends upon the knowledge that we possess. If we are aware of what can be done, only then we can make smarter and effective decisions. That is why it is always good to have quick Tips and Tricks handy in your pocket. This principle applies everywhere and even for MS-SQL Developers.

Through this article I would like to share a few SQL scripts which have proven to be very useful for my daily job as a SQL developer. A brief scenario about where each of these scripts can be used is presented along with the scripts below.

SAFETY PRECAUTION: Before reaping the benefits from these scripts, it is highly recommended that all of the provided scripts be run in a test environment first before running them on a real time database to ensure safety.

Search for a Text Inside All the Sql Procedures

Can we imagine a life without Ctrl+F in today’s world? Or a life without Search Engines! Dreadful isn’t it? Now imagine you have 20-30 sql procedures in your database and you need to find the procedures that contains certain word. Definitely one way to do it is opening each procedure one at a time and doing a Ctrl+F inside the procedure. But this is manual, repetitive and boring. So, here is a quick script that allows you to achieve this.

Compare Row Counts in Tables From Two Different Databases With Same Schema

If you have a large database and the source of data for your database is some ETL (extract - transform - load) process that runs on a daily basis this next script is for you. Say you have scripts that run on a daily basis to extract data into your database and this process takes about 5 hours each day. As you begin to look more deeply into this process you find some areas where you can optimize the script to finish the task under 4 hours. You would like to try out this optimization but since you already have the current implementation in Production server, the logical thing to do is try out the optimized process in a separate database which you would replicate using the existing database. Now once ready, you would run both ETL processes and compare the extracted data. If you have a database with many tables, this comparison can take quite a while. So, here’s a quick script that allows to facilitate this process.

Back Up Multiple Databases at Once

In any IT company, the first thing a new hire programmer (or sql developer) has to do before writing his first SQL query is buy an Insurance of the working version of the Production database i.e. take back up. This single act of creating back up and working with the back up version allows freedom to perform and practice any kind of data transformation as it ensures that even if he blows off company’s client’s data, it can be recovered. In fact not just new hires but even the veterans from the same IT company never perform any Data transformation without creating back ups. While taking back up of databases in SQL server is not a difficult task but it definitely is time consuming. Specially, when you need to back up many databases at once. So, the next script is quite handy for this purpose.

Shrink Multiple Database Logs at Once

Every SQL Server database has a transaction log that records all transactions and the database modifications made by each transaction. The transaction log is a critical component of the database and, if there is a system failure, the transaction log might be required to bring your database back to a consistent state. As the number of transactions starts increasing however, space availability starts becoming a major concern. Fortunately SQL server allows to reclaim the excess space by reducing the size of the transaction log. While once can shrink log files manually, one at a time using the UI provided, who has the time to do this manually isn’t it? The following script can be used to shrink multiple database log files rapidly.

Restrict Connection to the Database by Setting Single-User Mode

Single-user mode specifies that only one user at a time can access the database and is generally used for maintenance actions. Basically, if other users are connected to the database at the time that you set the database to single-user mode, their connections to the database will be closed without warning. This is quite useful in the scenarios where you need to restore your database to the version from certain point in time or you need to prevent possible changes by any other processes accessing the database.

String Function in SQL to Generate Dynamic Texts

Many programming languages allow inserting values inside string texts which is very useful when generating dynamic string texts. Since SQL doesn’t provide any such function by default, here is a quick remedy to that. Using the function below, any number of texts can be dynamically inserted inside string texts.

Printing Tables Columns Definitions

When comparing multiple databases that have similar schemas, one has to look at the details of table-columns. The definitions of the columns (data types, nullables?) are as vital as the name of the columns themselves. Now for databases having many tables and tables having many columns, it can take quite a while to compare each column manually with column from another table of another database. The next script can precisely be used to automate this very process as it prints the definitions of all tables for a given database.

Conclusion

In this article, we looked at 7 useful scripts that can cut down tons of manual laborious work and increase overall efficiency for SQL developers. We also looked at different scenarios where these scripts can be implemented. Once you begin to get the hang of these scripts, certainly you will begin to identify many other scenarios where these scripts can be used effectively. Good luck!


by Sovit Poudel via Envato Tuts+ Code

The Personal Theme Bundle (50% Off)

currl-bundle-thumb

We've teamed up with Currl to bring you this awesome Personal Theme Bundle deal. $29 gets you 3 beautiful One Page WordPress themes. Each theme features a gorgeous responsive design, slideshow backgrounds, a customizable call-to-action button, 23 SVG social network icons and full integration in the WordPress theme customizer.

by Rob Hope via One Page Love

Color Lisa

opl-small

Super long scrolling One Pager for 'Color Lisa' - a curated list of color palettes based on masterpieces of the worlds greatest artists.

by Rob Hope via One Page Love