Articles Tagged 'tips-&-tricks'


Retrieve the images loaded in a Post

When writing a Post in WordPress you can upload images to simultaneously writing the article. These images, which are part of the media library, are associated with that particular post. The peculiarity of this behavior lies in the possibility of extracting these images no matter if they were physically placed inside the post.

More ...

Getting latitutine and longitude in Google Maps

To find the coordinates of an address or latitude and longitude, we can use this simple and useful hacks. Open the site in Google Maps . Once on the map looking for the address you want (eg Via Cortese 10, Modena).

More ...

Very short snippet: Wordpress, coming soon on your blog

WordPress, like most of you know, allows you to publish a post "post-dated" (good pun). In practice, the post is stored with a date that is yet to come. This allows many bloggers to "schedule" (programmed) to publish a post without worrying about being in your console for the actual publication. It also allows you to keep publishing posts consistently even when we are on vacation.

More ...

Very short snippet: PHP slug

Who develops WordPress definitely knows the word slug , usually used to indicate the text strings that contain spaces or other "strange". In practice a URL string friendly, ie able to be used within a URL.

More ...

Very short trick: 3 output function in PHP

Within a PHP function can be printed in three different ways:

1
2
3
4
5
6
7
8
9
10
<? Php
$valore = 'Ciao' ) { miaFunction function ($ value = 'Hello') {
?>
<ul>
$valore ; ?> --> <! - <li> <? Php echo $ value;?> ->
?> </li> <li> <? = $ value?> </ li>
</ Ul>
<? Php
}
?>

Or:

1
2
3
4
$valore = 'Ciao' ) { miaFunction function ($ value = 'Hello') {
'<ul><li>' . $valore . '</li></ul>' ; $ O = '<li>'. $ Value. '</ Li> </ ul>';
; echo $ o;
}

Or:

1
2
3
4
$valore = 'Ciao' ) { miaFunction function ($ value = 'Hello') {
"<ul><li> $valore </li></ul>" ; $ O = "<li> $ value </ li> </ ul>";
; echo $ o;
}

More ...

Very short trick: undefined values ​​in Javascript

Is there a shortcut to assign "on the fly" a value to a variable if one is not defined (undefined), using the logical OR operator (| |) - double pipe:

1
2
3
4
5
/ / Foo is undefined
var bar;
pluto || '5' ; var foo = bar | | '5 ';
pippo ) ; alert (foo);
/ / Result: 5

More ...

Very short trick: faster loops in Actionscript

In Actionscript cycles for it is good to use them with care. For example, it is good to use variables uint when you can:

1
2
3
var i : uint = 0 ; i ++; i < 100 ) { for (var i: uint = 0; i + +; i <100) {
/ / ...
}

You can also use the - not always known - the form:

1
2
3
4
5
uint = 0 ; var i: uint = 0;
/ / ...
; i ++; i < 100 ) { for (; i + +; i <100) {
/ / ...
}

More ...

Very short trick: PHP echo car

In PHP you can use an abbreviated form, or contracted, to display variables or returns of functions:

1
2
3
4
5
6
7
8
/ / In place of
$miavar ?> <? Php echo $ miavar?>
/ / You can write
?> <? = $ Miavar?>
/ / In place of
miaFunc ( ) ?> <? Php echo miaFunc ()?>
/ / You can write
?> <? MiaFunc = ()?>

More ...

Movies resizable Flash: Act II

Returning to the Post StageExt Class: resizable Flash movies here is an even easier to get the same effect, only if the library for our movie is at least one Flash component!

Create a symbol, a red square 100 × 100 and place it in stages resizeWindow calling. Enter the library, not on the Stage, any component, such as a TextInput, and enter the following code in the first frame of the movie.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
managers . SystemManager ; import mx. managers. SystemManager;
/ /
scaleMode = "noscale" Stage . scaleMode = "noScale"
/ /
/ / SystemManager.init ();
( "resize" , resizeWindow ) ; SystemManager. AddEventListener ("resize", resizeWindow);
/ /
= function ( Void ) : Void { resizeWindow. resize = function (Void): Void {
Object = SystemManager . screen ; var s: Object = SystemManager. screen;
_width = s . width ; this. _width = s. width;
_height = s . height ; this. _height = s. height;
_x = Math . round ( s . x ) ; this. _x = Math . round (s. x);
_y = Math . round ( s . y ) ; this. _y = Math . round (s. y);
}
( ) ; resizeWindow. resize ();

Line 6 (SystemManager.init () ;) can be omitted.

More ...

Flight Simulator in Google Earth

Hear, hear ... for all fans of Flight Simulator here is a really tasty treat. Within Google Earth is a hidden flight simulator.

image

For attivarolo just open Google Earth and press the following key combinations:

  • Command + Option + A (Mac)
  • Ctrl + Alt + A (Windows)

For instructions see the flight: http://earth.google.com/intl/en/userguide/v4/flightsim/index.html

For more details see: http://marco-za.blogspot.com/2007/08/google-earth-flight-simulator.html

More ...



Stop SOPA