Nisi’s work blog

Nisi’s work blog – programing tips

jQuery Visual Cheat Sheet

If you are like me you “learn from walking” (learn something in time you write a script, an application ). jQuery is a great framework but it become so big that sometimes you can not remember all methods, selectors and basically every stuff  implemented there to make your work easy.

For this there are Cheat Sheet free PDF’s. This is made for jQuery 1.4.2 but easily can be used with all cheat sheet versions.

Download jQuery Visual Cheat Sheet from uploading.com (Free PDF)

Designed by Antonio Lupetti this pdf is realy a 4 pages gold book.

Post Source: http://woorkup.com/ (find there more Cheat Sheets and more)

jQuery, disable right click browser menu

When working on complex applications with jQuery you get to a point where you need to have your own right click menu.

You have the options to disable entire page right click menu or just for a div.

Disable for the entire document:

  1. $(document).ready(function()
  2. {
  3.        $(document).bind("contextmenu",function(e){
  4.               return false;
  5.        });
  6. });

Disable for a div:

  1. $(document).ready(function()
  2. {
  3.        $(‘#my_div’).bind("contextmenu",function(e){
  4.               return false;
  5.        });
  6. });

jQuery, check witch mouse button had been pressed

The .click is great, but witch button had been pressed?

  1. $(document).click(function(e) {
  2.    if ((e.button == 0)  && (e.button == 1)){
  3.       // was the left button pressed
  4.       alert(‘clicked’);
  5.    }
  6.    if (e.button == 3){
  7.       // was the right button pressed
  8.       alert(‘click’);
  9.    }
  10. });

How to display all Global variables in PHP

Sometimes when debugging an application you need to see all global variables.

In PHP there is an easy way:

  1. $defined_vars = get_defined_vars();
  2. print_r($defined_vars);

App Inventor and how easy is to work with it

Have you heard about App Inventor? No?

Do you want to write your own Android application instead looking on App Market for them and find that none of them are what you are looking for?

This is a App Inventor demonstration:

Now App inventor is not yet a visual programing language is just a Visual Programming Puzzle. You can do a lot of  stuff with it like putting a picture with a cat and make the phone to “miou” when you touch the picture, but for now App Inventor is not letting you to write custom code blocks and do very complex applications.

For more about App Inventor go to : http://appinventor.googlelabs.com/about/

How to Install Flash on your iPhone

In the last post I was talking about jailbreakme.com a website where you will find everything you need to escape from the Apple jail and install Apple unapproved apps on your iPhone.

You remember that your iPhone dont have Flash (if you dont just browse a flash website and you will see for yourself). Now on Jailbreak.com you can find “Frash” (yes Frash not flash becouse is just a port of the Flash). Frash is at the begining and cant render every flash on the web, have alot of errors (it can not play flash movies yet) but you can see most of flash websites that until now can not be displayed on your iPhone.

Now you for installing Frash you have to have a jailbroken phone (go to jailbreakme.com from your phone and install it)

Then the instructions are as follows:

  1. Launch Cydia and tap the “Manage” button
  2. Tap “Sources”
  3. Tap the “Edit” button (top-right)
  4. Tap “Add” (top-left)
  5. In the pop-up box, type http:///repo.benm.at/
  6. Tap “Add Source” to close the box
  7. Tap the “Done” button (top-right)
  8. Go to the “Search” section in Cydia and search for “Frash”
  9. Install the app.

Done!

Jailbreak your iPhone

Tired by App Store? Want more? go to JailbreakMe.com from your iPhone browser and be free.

What is Jailbreak?

“A jailbreak is simply the ability to run apps and use themes and tweaks not approved by Apple. Jailbreaking doesn’t slow down your device or use any extra battery. A jailbreak lets your device be how you want it.”

Is this legal in the USA?

“Yes. A new DMCA exemption was approved by the Library of Congress, specifically allowing jailbreaking.”

Steve Jobs (Apple) Vs Flash

iPhone and iPad will never see Flash. Why? Becouse Steve Jobs can not control what apps will emerge from Flash Developers.

Another example is “Justice League”. Look on the picture. On the top is a preview on Google Android. And at the bottom a preview from iPhone. Is not looking right on iPhone, something is missing.

Make your own website toolbar

Have you seen that almost every website have a toolbar? Why? Because with a toolbar designed for a specific website you can get your visitors to return every time you update your toolbar and your site.

Now you can start looking on toolbar tutorials start design one, working hours an hours on debugging and programing and debugging and …

Or … you can get an already available toolbar put your website or application logo put an rss or other already available gadgets and start promoting it. And if you cant find what you need use the toolbar API, html and flash to build what you have in mind.

And yes it is free and more you can make money with it when people download your toolbar.

Lets see some images:

And the money :

Where you can get this toolbar? At Conduit: http://www.conduit.com

The Quietly Brilliant Story of HTC