Friday, June 5, 2015

jQuery TreeTable – Show Tree Structure in Table

jQuery treetable is a jQuery plugin that you can display a tree in an HTML table with directory structure or a nested list.


by via jQuery-Plugins.net RSS Feed

Using the Digital Ocean API to Manage Cloud Instances

This week's JavaScript news, issue 235

Code smells, essential JS functions, var vs let vs const, and why Babel matters
Read this e-mail on the Web
JavaScript Weekly
Issue 235 — June 5, 2015
A great 30 minute talk by Elijah Manor showing off a variety of code smells (a symptom in source code of other underlying problems) and possible resolutions for them.
Elijah Manor

Short, useful functions aimed at front-end developers to do things like match a selector, get an absolute URL, or prevent a callback from being called multiple times within a certain timeframe.
David Walsh

ES6 lets us use three different explicit variable declaration techniques: var, let and const. Reg digs into their use and sees when they can replace one another.
Reg Braithwaite

Boost the performance of your .NET application with ANTS Performance Profiler. Get rich performance data on your code and database queries to find your application's bottleneck fast. Try ANTS Performance Profiler on your application now.
Red Gate Software   Sponsored
Red Gate Software

Babel mostly transpiles ES6 code into ES5 code that can run in today’s browsers, but also performs other optimizations. This post includes a compelling example of why it’s such a big deal.
Charles Pick

Jack sees pre-compilation becoming the default, the rise of libraries over frameworks, the popularity of ES7, and more.
Jack Franklin

Enabled in the latest Chrome, the Web MIDI API is here to play with. Here’s a quick look at how to do that from JavaScript.
Keith McMillen Instruments

A chat about Visual Studio’s recently improved Node.js support followed by a practical dive into creating a deploying an Express app using VS. (40 minutes.)
Channel 9

Jobs

In brief

Curated by Peter Cooper and published by Cooper Press.

Stop getting JavaScript Weekly : Change email address : Read this issue on the Web

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


by via JavaScript Weekly

A Walkthrough on Conditional Tags in WordPress: 40 to 52

In this series, we're going through one of the fundamental features of WordPress: Conditional Tags. In this fifth part, we'll continue introducing and reviewing the Conditional Tags. Be sure to check out the previous parts if you haven't yet.

Let's begin!

40. Checking Whether the Blog Is the "Main Site" of the Network: is_main_site()

If you're developing for WordPress Multisite, eventually there will come a time when you need to detect the main site. The Conditional Tag is_main_site will help you then: It determines whether the given site ID is the main site of the network.

Accepted Parameters

This Conditional Tag has only one parameter:

  • $site_id (integer, optional): The site's ID to check. (Default: Current site ID)

41. Checking Whether a Menu Location Has an Assigned Menu: has_nav_menu()

While creating a custom navigation menu, you need to specify a "menu location" with the two parameters of the register_nav_menu(s) function(s). The Conditional Tag has_nav_menu() checks whether there's a custom menu the user assigned to the given location.

Accepted Parameters

This Conditional Tag has only one parameter:

  • $location (string, optional): Slug of the menu location. (Default: None)

Usage Example for has_nav_menu()

Let's say one of the custom menu locations of your theme needs a little JavaScript file to work properly, so you want to enqueue the script only if the menu is being used by the user. Here's what you do:

42. Checking Whether the Specified Plugin Is Active in Multisite: is_plugin_active_for_network()

Similar to is_plugin_active(), the Conditional Tag is_plugin_active_for_network() will detect whether the given plugin is active... in a Multisite installation. This might be useful if your code needs to know whether another plugin is active through the whole network, rather than a single site.

Accepted Parameters

This Conditional Tag has only one parameter:

  • $plugin (string, required): Plugin's or sub-directory's name. (Default: None)

43. Checking Whether Comments Are Enabled: comments_open()

One of the most commonly used Conditional Tags is comments_open(). With this function in your if statement, you can determine whether comments are enabled in the current post.

Accepted Parameters

This Conditional Tag has only one parameter:

  • $post_id (integer, optional): The post ID. (Default: 0)

Usage Example for comments_open()

Let's say you want to echo a warning before the comments section, if comments are enabled for the post. Here's what you do:

44. Checking Whether a Sidebar Contains Any Widgets: is_dynamic_sidebar()

Many WordPress themes use sidebars to display widget content. But if you're developing a plugin or a theme and want to determine unused sidebars, you can use the Conditional Tag is_dynamic_sidebar()—it checks whether a sidebar is active and has any widgets used in it.

Accepted Parameters

This Conditional Tag doesn't accept any parameters.

45. Checking Whether There's More than One Author in the Blog: is_multi_author()

Most WordPress websites, I think, run with only one user. Corporate websites usually don't need more than one user, and the internet is filled with "personal blogs" (which is a good thing, don't get me wrong). However, you might want to check whether more than one author has published posts. If that's the case, is_multi_author() can help you detect WordPress installations with multiple authors.

Accepted Parameters

This Conditional Tag doesn't accept any parameters.

Usage Example for is_multi_author()

Let's say you're making a plugin just for blogs with multiple authors, and you want to warn single authors that the plugin won't work for them. Here's what you do:

46. Checking Whether Pings Are Open: pings_open()

If you still use trackbacks for some reason (or you need your plugin to work on really old blogs), you can determine whether trackbacks and pings are enabled in a specific post (or the post being displayed) with the help of the pings_open() Conditional Tag.

Accepted Parameters

This Conditional Tag has only one parameter:

  • $post_id (integer, optional): The post ID. (Default: 0)

47. Checking Whether a Feed Is Being Displayed: is_feed()

I still love feeds, but they are an obsolete part of the web nowadays. And WordPress uses them, too: It supports four different kinds of feeds in its core. If you want your function to know when it's running in a feed, you can use the is_feed() Conditional Tag—it checks whether the current query is for a feed.

Accepted Parameters

This Conditional Tag has only one parameter:

  • $feeds (string/array, optional): Feed types. (Default: None)

Usage Example for is_feed()

Let's say you want to publish extra content in each post for your feeds (to encourage more people to subscribe). You will need a shortcode. Here's what you do:

48. Checking Whether the Page Is a "Yearly Archives" Page: is_year()

In blogs that you don't write frequently, it might be a better idea to promote yearly archives rather than monthly archives. And if you want to add different functionality or display a different design, you can use is_year() to detect year-based archive pages.

Accepted Parameters

This Conditional Tag doesn't accept any parameters.

49. Checking Whether the Visitor Is a Logged-in User is_user_logged_in()

It's a common thing to run different code for logged-in users: It might be a new menu item, it might be an extra comment field, or it might be a completely different website design. Whatever the case may be, you can detect logged-in users with the is_user_logged_in() Conditional Tag.

Accepted Parameters

This Conditional Tag doesn't accept any parameters.

Usage Example for is_user_logged_in()

Let's say you want to greet your users differently than visitors. Here's what you do:

50. Checking Whether the Attachment Is an Image: wp_attachment_is_image()

This Conditional Tag's job is very simple: You pass the post ID as the parameter, and the Conditional Tag returns TRUE if the post's attachment is a JPG, JPEG, GIF or PNG file (and FALSE if it's not).

Accepted Parameters

This Conditional Tag has only one parameter:

  • $post_id (integer, virtually required, technically optional): The post ID. (Default: 0)

Why "virtually required" and "technically optional"? Because it defaults to 0, meaning that if you use this Conditional Tag without its parameter, it will try to return a post that doesn't exist.

51. Checking Whether the Given Post Type Exists: post_type_exists()

In some scenarios, it might be a good idea to check whether a certain custom post type is already in use. (If you're creating a portfolio plugin, for example, you might want to try to duplicate posts from a commonly used post type name for portfolios.) To do that, you can use the post_type_exists() Conditional Tag.

Accepted Parameters

This Conditional Tag has only one parameter:

  • $post_type (string, required): Name of the post type. (Default: None)

Usage Example for post_type_exists()

Let's say you're developing a "portfolio" plugin and you chose the custom post type name "portfolio" (naturally). But many developers use the same name for portfolio post types, so you need to warn the user if another plugin or theme has already registered the post type:

52. Checking Whether the Current Post Is Published on a New Day: is_new_day()

Some WordPress functions solve the tiniest issues, and is_new_day() is one of them: This particular Conditional Tag returns TRUE if the current post's day is different than the previous one.

Accepted Parameters

This Conditional Tag doesn't accept any parameters.

Conclusion

In this part, we reviewed another batch of the 65 documented Conditional Tags in WordPress. In the next part, we're going to go through the remaining 13. If you have any questions or comments, shoot them below—and if you liked this article, don't forget to share it!

See you in the next part!


by Barış Ünver via Tuts+ Code

How a Blog Launched a Movement: The Vani Hari Story

Do you have a blog? Want to use your blog to inspire change? This episode explores how a blogger followed her passion and grew a mega following in a few short years. More About This Show The Social Media Marketing podcast is an on-demand talk radio show from Social Media Examiner. It’s designed to help […]

This post How a Blog Launched a Movement: The Vani Hari Story first appeared on Social Media Examiner.
Social Media Examiner - Your Guide to the Social Media Jungle


by Michael Stelzner via Social Media Examiner

Giampiero Bodino

Giampiero Bodino - Italian High Jewellery - Villa Mozart, Milano
by via Awwwards - Sites of the day

Free Writing Icons

This freebie contains common writing symbols such as pens, pencils, an eraser, and more.

There are 97 unique icons in this freebie. The file formats available are PNG, AI, EPS and SVG. This icon pack is by Icons8.

Features

Easy to customize

The icons are vector-drawn. This makes it possible to edit and tweak each icon to suit your needs.

The icons are easy to edit in graphics software such as Illustrator.

Editable source files are included. AI, EPS, and SVG can be edited in Photoshop, Illustrator, Fireworks, Sketch, etc.

Change size without affecting image-quality

For Web use, responsive design can be achieved using the SVG versions of the icons. The icons will look great, regardless of the device. For print, the AI or EPS files can be used to change the size of the images without surrendering visual-clarity.

The icons can be used in responsive designs.

Optimized for Web performance

The Web files of the icons are already optimized. They will load as fast as possible when viewed in a browser. After optimizing the icons, the SVG file sizes decreased by about 60%.

Easy to use

The editable source files are organized well. The layers are intuitively named. They are even color-coded for your convenience.

The editable source files of the icons are well-organized.

License

These icons can be used for free as part of your projects, even if said project is commercial in nature. See the README.txt file included in the icon package for more details on license/terms of use.

Download

Related Content

Icons8 is an icon search app. The Icons8 team is a small squad of designers and developers who are passionate about icons. Connect with Icons8 on Twitter, Facebook and GitHub.

The post Free Writing Icons appeared first on Six Revisions.


by Jacob Gube via Six Revisions