Latest Articles

Anonymous functions

I was asked what the advantage or disadvantage in the use of anonymous functions or inline (or onfly), and used a lot in JavaScript, now with 5.3, also in PHP.
An inline function, or anonymous because he did not - in fact - a name, is a quick way to write some procedures, indenting tree sequences such as the callback. Almost all languages ​​support functions of this writing, each to the limit with its peculiarities and restrictions. They may also have different names and syntax details, such as the so-called Objective-C blocks.

Continued ...

Poll: Paid CMS Software

WordPress Snippet: extract meta get_posts value with ()

Working with a Custom Post Type ( CPT ) is natural to use the internal functions of WordPress to display and filter the posts of this type. , risulta comodissimo poter creare loop personali sulle proprie tipologie di post. Whether you use the get_posts() is that you create an object directly WP_Query , it is convenient to create loops on their own personal types of posts. WordPress also allows for filters for personal tassionomie, on the count, order, coming up to the meta data. Brand new, in fact, is the process that allows you to specify the conditions where that kind of meta data and compare it with rules.

Continued ...

OS X: Keyboard and Memory

, comodissime per andare rispettivamente a fine e inizio riga. Two almost personal annotations, otherwise I forget them, especially the first one: loss of function with the combination CMD+freccia destra or CMD+freccia sinistra , very comfortable to go respectively to the end and beginning of the line. I do not know if anyone has happened but it can happen for no apparent reason, that the above key combinations stop working! I realized as I wrote the code are one of the most frequently used combinations. Well, this "bug" seems to be linked to the full screen applications; mode introduced with OS X Lion.

Continued ...

Bachi beginning of the year: WordPress and WPML get_page_by_path update ()

The year 2012 began with a few hours of deep-debugging because of two (known) bugs quite annoying. , con la globale (e famosa) omonima istanza $wpdb . The first, among other things, rather dated, present in the core of WordPress regarding the method update() class wpdb , with the global (and famous) instance of the same name $wpdb . The defect appears when you try to update a field to NULL . Despite numerous complaints, the WordPress development team does not seem to find a solution to the annoying problem. In fact, to date, the only solution is to write the SQL for your account.

Continued ...

WordPress Snippet: The action save_post

When you add additional fields to the pages and post, or to get Custom Post Type ( CTP ), you have to record an action to save these new data. The implementation of this procedure is essentially always the same, changing only the fields and how to save, the extra data can reside in the 'custom field', ie after half the table, or tables of one or more personal.

Continued ...

Snippets

WordPress Snippet: is_page () Custom Post Type

If you recorded your own Custom Post Type (CPT), especially if you type 'page', you could serve to determine if you are viewing that particular page, the 'single' so to speak. In this case it is useless to try is_page () or is_page_template (). The clean solution is as follows: 123456if (is_singular ('cpt_key')) {global $ post; if ($ post-> post_name [...]

Continued ...

WordPress 3.3: now all jQuery

With WordPress 3.3 jQuery and also all of its modules have been aligned. Now it is possible to access the new list of modules in the latest release 3.3, such as the autocomplete. Here is a snippet for a good inclusion: 123456 / / modules that WordPress will load for us preparatory to the script "MyScript.js" $ deps = array ('jquery-ui-slider', 'jquery-ui-datepicker', 'jquery-ui -autocomplete '[...]

Continued ...

WordPress Snippet: add styles and scripts to Custom Post Type

Now that WordPress allows you to create custom post types (CPT), it becomes useful to be able to add our styles and our script when you view or edit our posts. The best way to do that is compatible with release 3.3 is the following: 1234567add_action ('admin_enqueue_scripts', function () {global $ typenow if ($ typenow == 'id_custom_post') [...]

Continued ...

WordPress Snippet: src thumbnail

WordPress allows you to associate a thumbnail to a post, page or post customized. If it is easy to extract the entire image code, thanks to features the_post_thumbnail () or get_the_post_thumbnail, that return the full img tag, it is less intuitive how to get the single link: 1234 / / if $ post_id is the id of the post $ image_id get_post_thumbnail_id = ($ post_id); $ image = wp_get_attachment_image_src ($ image_id, 'full'); [...]

Continued ...

Tips & Tricks

Very short trick: maintenance mode via IP

When developing a product (website, Blog, Facebook application) online, if you have not been able to build an infrastructure development / operation may be necessary under certain circumstances to "off-line" service, for updates, debugging or interventions maintenance. WordPress, for example, can be deactivated with simple and convenient Plugins, as Maintenance Mode.

Continued ...

Very short trick: log JavaScript objects

If you are to develop in an environment where it is impossible to use debugging tool like Firebug, such as the Apple iPhone simulator in Xcode, it can become frustrating to find problems, including an incorrect access to all properties of an object. Here is that the use of works alert () is fundamental!

Continued ...

Very short trick: how to use NSFileManager

Apple recommends using the instance of the object and not its NSFileManager meotodo defaultManager class, as the latter returns an instance singleton, ie the same pointer to the object (not thread safe).

Continued ...

Tutorials

iPhone FontsBook: source code to display the system font

Rounding out the article How To: Custom fonts on iPhone OS 3.2 will suggest the sources of FontsBook, a simple iPhone application that shows a table all system fonts, grouped by family.

Continued ...

How To: Custom fonts on iPhone OS 3.2

How to insert and use fonts in our personal applications iPhone / iPad, iPhone OS 3.2 + only

Continued ...

Objective-C: how to rotate an image in 3D space

The UIView class exposes a pointer to the layer (CALayer), an object of the lower level with vast potential. The layer provides a variety of methods and properties related to displaying the contents of the view. For example, you can manipulate the contents of a view in three dimensional space. In this example it is interesting to carry [...]

Continued ...

Objective-C: obtain information from Latitude and Longitude

Reply to Mirko asking me how to make the reverse proposed Getting Latitude and Longitude in Objective-C. Starting from the values ​​of Latitude and Longitude you can use the class MKReverseGeocoder to obtain a range of information, such as: city, state, address in full, chap!

Continued ...

Very short snippet: slideshow 10 lines of code

Let me show you how to implement a simple Slideshow of images with very few lines of code, using jQuery. This technique can be implemented on any type of website, the important thing is to include the jQuery library. I used this technique to a site built in WordPress, developed in a few hours for an event.

Continued ...

How to get Latitude and Longitude in Objective-C

The framework provides MapKit many useful features, except the return of Longitude and Latitude from an address. In JavaScript, for example, you can use the service provided by Google Geocoding in Google Maps and discussed: how to get Latitude and Longitude from an address. Apple iPhone or iPad, however, you can overcome [...]

Continued ...

Objective-C

Objective-C: Addendum on notifications and delegates

With multiple video AVQueuePlayer

Objective-C: how best to use the property list files

Xcode4: backward compatible code

Objective-C: Notifications and Delegates

PHP

WordPress Delete Post

Sort an array of arrays in PHP

Very short snippet: set the log files on WordPress

MySQL: select random paging

WordPress shortcode Table

JavaScript

Fixed bug: jQuery UI on the calendar year range

PhpStorm 2.0

jQuery snippets

Very short snippet: how to identify the Ajax calls in PHP

How to select a group of tags that do not have children of a certain type

CSS

The rule of the AND logic in CSS

Firefox 3.5.7: how to fix the defect of the rounded edges of an image

Customizing a Form graphically

A WordPress theme for all

Very short trick: Conditional CSS and optimization


Stop SOPA