Monday, September 14, 2015

Getting Started With HealthKit: Part 1

How to Pitch Freelance Services to Small Businesses

Most freelancers share a common dream. No, not the one where the IRS nixes all of your coffee shop tax deductions. It’s the dream of never having to pitch to clients. No more cold calls or unsolicited emails. No more selling your services to strangers. It’s a dream of self-replicating referrals. But the road to […]

Continue reading %How to Pitch Freelance Services to Small Businesses%


by Joshua Kraus via SitePoint

Drupal 8 Third Party Settings and Pseudo-Fields

In the first installment of this series we started our journey towards creating some simple but powerful functionality. The goal we set was to have the possibility to load a form on each node page and to be able to choose which form type should be used on the different node bundles.

Drupal 8 logo

The first step is done. We created a custom plugin type called ReusableForm already featured with a base plugin class that new plugins can extend. Additionally, we saw that each plugin will interact with a form class that is defined in their annotation. And like with the plugins, we also created a base class new forms can extend.

It follows to see how we can configure the core node types to use one of the plugins defined on the site and how to render the relevant form when viewing the node. But first, in order to have something to work with, let’s create our first ReusableForm plugin that uses a very simple form.

Our first plugin

Inside the src/Form folder of our module, create a class called BasicForm.php (or whatever you want to call it). Inside, we can have this simple form definition:

Continue reading %Drupal 8 Third Party Settings and Pseudo-Fields%


by Daniel Sipos via SitePoint

Create Elegant (but Easy) Interactions Using Sketch & Atomic.io

I’ve spoken in favour of Sketch App for months now, and aside from having discovered many different reasons to use it for all types of design work, I still in fact find more reasons everyday.

One of the more recent incentives is the beta release of Atomic.io, which I find surprisingly similar to Sketch in terms of interface and executability.

SKETCH APP INTERACTIONS IN ATOMIC.IO

I wrote about Atomic.io only recently, where we created a basic icon directly in Atomic and demonstrated how the icon would animate if we interacted with it, but this time we’re going to design something in Sketch and copy it over to Atomic.

Here’s an example animation of what we’ll be making.

Creating a Simple Loading Screen Animation in Sketch

When you open an app for the first time you might be shown a tiny animation that lets the user know that their app is loading. Lets assume that SitePoint has hired us to create said animation and we’ll design the screen in Sketch App first. Press “A” to start with and select the iPhone 6 artboard from The Inspector.

It needs a blue background (#4494c2 will do), but we’ll want to animate it in Atomic later on so an artboard background would not be suitable in this case. Instead, create a Rectangle (“R”) as big as the artboard and add a blue fill, emulating a background.

Make sure to remove the default border, and repeat this step once more with a white background (leave it underneath the blue).

Press “T” to create some text (any colour, any size, it doesn’t matter) and once again move it behind all the other layers. We’ll call it “App”, and all this will do is demonstrate how our hypothetical app will animate in after the loading screen.

[caption id="attachment_114754" align="aligncenter" width="965"]Setting Up the Artboard in Sketch Setting Up the Artboard in Sketch[/caption]

Press “R” again, remove the default border, and create a white rectangle that is 50x16px with a Rotate of -45deg. When that’s done, Duplicate it (command+d) and use the horizontal flip button (next to Rotate). It should look something like this.

[caption id="attachment_114755" align="aligncenter" width="965"]Constructing Our First Shape Constructing Our First Shape[/caption]

Hold Shift while you select both of these rectangles at the same time, and lets starting using some tools from the menu bar up top. You’ll need to use these tools in this order:

  1. Union
  2. Flatten
  3. Edit

After using the Edit tool, it’ll be obvious that our rectangles have now become a singular flattened vector shape, and that we can edit its points. While holding Shift again, select three of them (in the image below these are highlighted in black) and use the inspector to change the Corners to 5. Almost there.

Adding Corner Radius to Vector Points

Duplicate, flip, and move both layers until we have this:

[caption id="attachment_114757" align="aligncenter" width="965"]Finalising Our Design in Sketch Finalising Our Design in Sketch[/caption]

Copying Layers from Sketch to Atomic

We’re done with our .sketch file now. Open your web browser and skip over to Atomic.io. Login (or register if you’ve never used it before), create a “New Project” and then “New Design”; the first thing we need to do is select the “Pages” tab (on the left) and then look to the opposite side of the screen and choose the iPhone 6 Portrait Preset.

[caption id="attachment_114758" align="aligncenter" width="1366"]Creating the Artboard in Atomic Creating the Artboard in Atomic[/caption]

What we have now is a blank canvas, and this step mainly involves copying layers from Sketch App into Atomic. Copying-in the entire artboard won’t work because Atomic will force this into a singular flattened layer. But that doesn’t matter - we need to split our design into several Pages anyway, to represent the different stages in the animation. Copy the layers in first.

[caption id="attachment_114759" align="aligncenter" width="1366"]Copying Layers Over to Atomic Copying Layers Over to Atomic[/caption]

Setting the Stage in Atomic

Lets move all the layers to where they should be - “setting the stage” so to speak. Our “App” text layer will slide in from the right, so it’s not needed on stage at the moment. Make the “X” axis of this layer “373px” so that it appears off-stage.

Do the same for our white background.

Make sure “App” is entered vertically.

You’ll need to switch to the Layers Panel before you can select an individual layer. Flick back to Pages, click the hamburger menu, and Duplicate. Do it again so there’s three versions of this same screen. Now lets start with the first screen.

One “Page” Equals One Stage of the Animation

Our animation will begin with the logo not visible. Since our logo consists of two layers, make the left side appear off-screen to the left, and the right side appear off-screen to the right. In the next step we will animate these layers to fly in from either side of the canvas with a smooth bouncy effect.

Page one looks a little blank at the moment; this is desired.

[caption id="attachment_114760" align="aligncenter" width="1366"]Setting the Stage in Atomic Setting the Stage in Atomic[/caption]

Page two is fine as it is.

Skip to number three and select all of the layers at once by holding Shift as you do so, then drag the layers so that the white background fills the canvas completely, and our blue background (+logo) is now off-stage. Since all layers were converted to images when we copied them from Sketch, our “App” text layer has now lost its auto-width. You’ll need to move that layer manually so that it snaps to the dead-center grid.

Continue reading %Create Elegant (but Easy) Interactions Using Sketch & Atomic.io%


by Daniel Schwarz via SitePoint

Ruby on Medicine: Counting Word Frequency in a File

Welcome to a new article in SitePoint's Ruby on Medicine series, where I show how the Ruby programming language can be applied to tasks related to the medical domain.

Newbie, moderate, and advanced Ruby programmers can benefit from this series, in addition to health/medical researchers and practitioners looking forward to learning the Ruby programming language, and apply it to their domain.

In this article, I'm going to show you how we can use Ruby to check the frequency of occurrence of words in some file. Counting the frequency of occurrence of words can come in handy in large text files, such as the OMIM^®^ – Online Mendelian Inheritance in Man^®^ file, which we worked with in the last article.. The reason counting the frequency of words could be beneficial is that going through the list of words and their frequencies will give us a more sense of what the document is about. It can also pinpoint any mistakes and misspellings, especially when we have a dictionary to compare against. When a word from the dictionary is not listed in your output, for instance, you can simply conclude that a misspelling has occurred to that word, or abbreviations were used rather than the words themselves.

Continue reading %Ruby on Medicine: Counting Word Frequency in a File%


by A. Hasan via SitePoint

Creating Backdrops and Sprites in Scratch

Responsive Sidebar Navigation

A nice tutorial about creating Responsive Sidebar Navigation. It's easy-to-integrate side, vertical navigation, ideal for dashboards and admin areas.


by via jQuery-Plugins.net RSS Feed