2 Page 1 of 2 1 2

Very short snippet: get the output of a URL in Objective-C

Friday, February 5, 2010

Perhaps I should have written "Very very very, short snippets," but it is an excellent and convenient "trick" that I am about to show. Doing the "two" lines of code shown below, you can get the output of any URL and manipulate it. PLAIN TEXT Objective-C: NSString * url = [NSString stringWithFormat: @ "http://www.appleside.it/ "]; NSString * result = [NSString stringWithContentsOfURL: [NSURL URLWithString: url] [...]

10 Useful snippet for Apple iPhone

Friday, January 8, 2010

Execute a method in n seconds performSelector The whole family is really interesting and may be useful in a multitude of cases. Its application simplest and most common is this: PLAIN TEXT Objective-C: [self performSelector: @ selector (myMethod) withObject: nil afterDelay: 3] / / - (void) (myMethod NSLog (@ "Hello World!" );) however, that the "timer" is not precise. This procedure, therefore, must be used when there is [...]

Very short snippet: Apple iPhone file system

Saturday, November 21, 2009

Both Mac OS X and iPhone OS, we can have easy and direct to the directories - more important - the system which are: PLAIN TEXT CODE: NSHomeDirectory Returns the path to the current user's home directory. NSHomeDirectoryForUser Returns the path to a given user's home directory. NSTemporaryDirectory Returns the [...]

Very short snippet: iPhone, random numbers

Friday, October 9th, 2009

If you need to generate random numbers in an application from the Apple iPhone you have to put Objective-C, because it proposes no class for this purpose. The solution is that proposed by the C: rand (), srand (), random (), srandom () and arc4random (). Of all the most popular is definitely arc4random (), because it requires no special initialization or duties of [ ...]

Very short snippet: PHP, cut lip, counting the characters

Monday, September 14, 2009

As seen in very short snippet: PHP word cut is more pleasant break a text to "words", because it avoids cutting a word. There is still counting those who prefer to cut the characters, as it makes "cuts" more homogeneous and similar, despite the strong likelihood of cutting a word, precision of [...]

Very short snippet: Wordpress, improve the search field

Monday, September 7th, 2009

Besides the graph of the input field of search of WordPress, you can act on it in the code to make it a little interactive when you click inside it. Easy to achieve an effect lets you insert text into the search field that disappears (and reappears when you exit [...]

Very short snippet: Wordpress, soon on your blog

Thursday, July 2, 2009

WordPress, like most of you know, can you post "post-dated" (great pun). In practice, the post is stored with a date that has yet to arrive. This allows many bloggers to "schedule" (schedule) publishing post without worrying about being physically present in the console for the publication itself. Also [...]

Very short snippet: how to retrieve the parent category in Wordpress

Friday, March 20, 2009

In Wordpress categories can be organized into a structure to be "father" "son". This means that a single post can belong to several categories. It may be helpful in some cases cause, whatever the "children", which is the parent category of a post: PLAIN TEXT PHP: / ** * Returns the parent category of a post * * @ return * @ param object [.. .]

Very short snippet: jQuery auto target blank link

Monday, December 15, 2008

Nothing new, but the sign to remind me: how to add a picture to all the links that open a new page: PLAIN TEXT JavaScript: jQuery ( 'a [@ target = _blank]'). AddClass ( 'external'); class extenal css looks like this: PLAIN TEXT CSS:. external (background: url (images / external.png) no-repeat right 3px; padding-right: 14px) As an image you can use: The result is miolink Related Post How to select a group of tags that do not have children of a certain type (0) Wordpress: [...]

Very short snippet: Wordpress, separate the categories into two columns

Wednesday, November 19, 2008

Taking a cue from Wordpress Hack # 2 - Separate the categories in the columns in the sidebar can be useful "break" into two columns list the categories of Wordpress. If the sequence we want to achieve is from left to right, ie cat1 | cat2 (leader) cat3 | cat4 (leader) etc ... is not necessary to use a [...]

2 Page 1 of 2 1 2