Dynamically Created iFrame Loads Wrong Source URL on Reload / Refresh
Aug 19th
This is a known FF bug.
Reference this URL for the exact bug and it’s status: https://bugzilla.mozilla.org/show_bug.cgi?id=279048
There should be few hacks to avoid this bug but here is one solution using Javascript.
Run following after all iFrames are generated/written.
var f=document.getElementsByTagName("iframe");
for(var i=0;i<f.length;i++){
if(f[i].src.substr(f[i].src.length-1)=="#") f[i].src=f[i].src.substr(0,f[i].src.length-1);
else f[i].src=f[i].src+"#";
}
Basically loops through all iFrames and add # to URL source.
By doing so updates Fx with the correct URL instead of any cached ones.
Magento Login Keep Redirecting Back (Cant Login)
Apr 9th
Mine happened when I installed the Magento on Localhost (Apache).
Problem:
I had a new installation of magento. But I was unable to login as an administrator. I went to the admin login page, entered correct username and password but was redirected to the same login page. I could not enter the dashboard page. Error message is displayed when I enter wrong username or password. But nothing is displayed and I am redirected to the same login page when I insert correct username and password.
Solution:
I googled and found these solutions:-
1) Use 127.0.0.1 instead of localhost in your url, i.e. using http://127.0.0.1/magento/index.php/admin instead of
http://localhost/magento/index.php/admin . But this didn’t solve my problem.
2) Since I am using Windows XP, I was suggested to open “host” file from
C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost or even 127.0.0.1 point to http://www.localhost.com . But this also didn’t work either.
3) This solution finally helped me out of this problem. The solution was to modify the core Magento code. Open app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the lines 80 to 83. The line number may vary according to the Magento version. But these lines are present somewhere near line 80.
// set session cookie params session_set_cookie_params( $this->getCookie()->getLifetime(), $this->getCookie()->getPath()//, //$this->getCookie()->getDomain(), //$this->getCookie()->isSecure(), //$this->getCookie()->getHttponly() );
Update (For Magento 1.4.*)
In Magento 1.4, you have to comment code from line 86 to 98 in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Like this:
/* if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
} */
Add www using .htaccess redirect
Apr 7th
If you are like me, where your website shows two different versions when accessing your domain with www and without www, then you may want to redirect all access without www to the correctly showing version with www.
This may sound very confusing to some people… so here is another way to explain it.
If you add below code to your .htaccess (this is the file name) on your root folder of your domain, it will redirect:
Access to your website using (yourdomain.com) to (www.yourdomain.com).
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Disable Right Mouse Click in Flash on Facebook App AS3
Feb 9th
Just add below line of code into Actionscript class of your actionscript 3 flash file.
stage.showDefaultContextMenu=false;
How to Restore Desktop Recycle Bin / Trash
Feb 6th
Have you accidentally removed the trash bin from your desktop?
Here is how you can restore it.
- Click Start -> Run -> type Control desk.cpl„@Web and press Enter
- In the Desktop Icon Settings dialog, enable the Recycle Bin checkbox
- Click OK
Page Conditioning — Wordpress Theme Editing
Feb 5th
If you are starting to learn about Wordpress theme editing, you will probably come across a situation where you need to identify which page is being displayed to add or remove specific image or asset to that particular page. For example, you may want to find out if the current page is Homepage or Contact us page.
In this case, you need to add page conditioning.
It is actually standard feature of Wordpress but not many people are aware that there already is a page setup in Wordpress website on this exact topic.
Visit following page to read about page conditioning in detail: http://codex.wordpress.org/Conditional_Tags
RUN commands for Windows XP / Windows VISTA
Jan 29th
For all those geeks out there including myself who wants to look cool with shortcut or quick run commands, below are the commands for frequently accessed program / tools on Windows. Most will work for Vista as well.
|
Program / Tool
|
Run Command
|
|---|---|
| Accessibility Controls | access.cpl |
| Accessibility Wizard | accwiz |
| Add Hardware Wizard | hdwwiz.cpl |
| Add/Remove Programs | appwiz.cpl |
| Administrative Tools | control admintools |
| Adobe Acrobat (if installed) | acrobat |
| Adobe Designer (if installed) | formdesigner |
| Adobe Distiller (if installed) | acrodist |
| Adobe ImageReady (if installed) | imageready |
| Adobe Photoshop (if installed) | photoshop |
| Automatic Updates | wuaucpl.cpl |
| Bluetooth Transfer Wizard | fsquirt |
| Calculator | calc |
| Certificate Manager | certmgr.msc |
| Character Map | charmap |
| Check Disk Utility | chkdsk |
| Clipboard Viewer | clipbrd |
| Command Prompt | cmd |
| Component Services | dcomcnfg |
| Computer Management | compmgmt.msc |
| Control Panel | control |
| Date and Time Properties | timedate.cpl |
| DDE Shares | ddeshare |
| Device Manager | devmgmt.msc |
| Direct X Control Panel (if installed)* | directx.cpl |
| Direct X Troubleshooter | dxdiag |
| Disk Cleanup Utility | cleanmgr |
| Disk Defragment | dfrg.msc |
| Disk Management | diskmgmt.msc |
| Disk Partition Manager | diskpart |
| Display Properties | control desktop |
| Display Properties | desk.cpl |
| Display Properties (w/Appearance Tab Preselected) | control color |
| Dr. Watson System Troubleshooting Utility | drwtsn32 |
| Driver Verifier Utility | verifier |
| Event Viewer | eventvwr.msc |
| Files and Settings Transfer Tool | migwiz |
| File Signature Verification Tool | sigverif |
| Findfast | findfast.cpl |
| Firefox (if installed) | firefox |
| Folders Properties | folders |
| Fonts | control fonts |
| Fonts Folder | fonts |
| Free Cell Card Game | freecell |
| Game Controllers | joy.cpl |
| Group Policy Editor (XP Prof) | gpedit.msc |
| Hearts Card Game | mshearts |
| Help and Support | helpctr |
| HyperTerminal | hypertrm |
| Iexpress Wizard | iexpress |
| Indexing Service | ciadv.msc |
| Internet Connection Wizard | icwconn1 |
| Internet Explorer | iexplore |
| Internet Properties | inetcpl.cpl |
| Internet Setup Wizard | inetwiz |
| IP Configuration (Display Connection Configuration) | ipconfig /all |
| IP Configuration (Display DNS Cache Contents) | ipconfig /displaydns |
| IP Configuration (Delete DNS Cache Contents) | ipconfig /flushdns |
| IP Configuration (Release All Connections) | ipconfig /release |
| IP Configuration (Renew All Connections) | ipconfig /renew |
| IP Configuration (Refreshes DHCP & Re-Registers DNS) | ipconfig /registerdns |
| IP Configuration (Display DHCP Class ID) | ipconfig /showclassid |
| IP Configuration (Modifies DHCP Class ID) | ipconfig /setclassid |
| Java Control Panel (if installed) | jpicpl32.cpl |
| Java Control Panel (if installed) | javaws |
| Keyboard Properties | control keyboard |
| Local Security Settings | secpol.msc |
| Local Users and Groups | lusrmgr.msc |
| Logs You Out Of Windows | logoff |
| Malicious Software Removal Tool | mrt |
| Microsoft Access (if installed) | msaccess |
| Microsoft Chat | winchat |
| Microsoft Excel (if installed) | excel |
| Microsoft Frontpage (if installed) | frontpg |
| Microsoft Movie Maker | moviemk |
| Microsoft Paint | mspaint |
| Microsoft Powerpoint (if installed) | powerpnt |
| Microsoft Word (if installed) | winword |
| Microsoft Syncronization Tool | mobsync |
| Minesweeper Game | winmine |
| Mouse Properties | control mouse |
| Mouse Properties | main.cpl |
| Nero (if installed) | nero |
| Netmeeting | conf |
| Network Connections | control netconnections |
| Network Connections | ncpa.cpl |
| Network Setup Wizard | netsetup.cpl |
| Notepad | notepad |
| Nview Desktop Manager (if installed) | nvtuicpl.cpl |
| Object Packager | packager |
| ODBC Data Source Administrator | odbccp32.cpl |
| On Screen Keyboard | osk |
| Opens AC3 Filter (if installed) | ac3filter.cpl |
| Outlook Express | msimn |
| Paint | pbrush |
| Password Properties | password.cpl |
| Performance Monitor | perfmon.msc |
| Performance Monitor | perfmon |
| Phone and Modem Options | telephon.cpl |
| Phone Dialer | dialer |
| Pinball Game | pinball |
| Power Configuration | powercfg.cpl |
| Printers and Faxes | control printers |
| Printers Folder | printers |
| Private Character Editor | eudcedit |
| Quicktime (If Installed) | QuickTime.cpl |
| Quicktime Player (if installed) | quicktimeplayer |
| Real Player (if installed) | realplay |
| Regional Settings | intl.cpl |
| Registry Editor | regedit |
| Registry Editor | regedit32 |
| Remote Access Phonebook | rasphone |
| Remote Desktop | mstsc |
| Removable Storage | ntmsmgr.msc |
| Removable Storage Operator Requests | ntmsoprq.msc |
| Resultant Set of Policy (XP Prof) | rsop.msc |
| Scanners and Cameras | sticpl.cpl |
| Scheduled Tasks | control schedtasks |
| Security Center | wscui.cpl |
| Services | services.msc |
| Shared Folders | fsmgmt.msc |
| Shuts Down Windows | shutdown |
| Sounds and Audio | mmsys.cpl |
| Spider Solitare Card Game | spider |
| SQL Client Configuration | cliconfg |
| System Configuration Editor | sysedit |
| System Configuration Utility | msconfig |
| System File Checker Utility (Scan Immediately) | sfc /scannow |
| System File Checker Utility (Scan Once At The Next Boot) | sfc /scanonce |
| System File Checker Utility (Scan On Every Boot) | sfc /scanboot |
| System File Checker Utility (Return Scan Setting To Default) | sfc /revert |
| System File Checker Utility (Purge File Cache) | sfc /purgecache |
| System File Checker Utility (Sets Cache Size to size x) | sfc /cachesize=x |
| System Information | msinfo32 |
| System Properties | sysdm.cpl |
| Task Manager | taskmgr |
| TCP Tester | tcptest |
| Telnet Client | telnet |
| Tweak UI (if installed) | tweakui |
| User Account Management | nusrmgr.cpl |
| Utility Manager | utilman |
| Windows Address Book | wab |
| Windows Address Book Import Utility | wabmig |
| Windows Backup Utility (if installed) | ntbackup |
| Windows Explorer | explorer |
| Windows Firewall | firewall.cpl |
| Windows Magnifier | magnify |
| Windows Management Infrastructure | wmimgmt.msc |
| Windows Media Player | wmplayer |
| Windows Messenger | msmsgs |
| Windows Picture Import Wizard (need camera connected) | wiaacmgr |
| Windows System Security Tool | syskey |
| Windows Update Launches | wupdmgr |
| Windows Version (to show which version of windows) | winver |
| Windows XP Tour Wizard | tourstart |
| Wordpad | write |
Free Game Design Scripts For Flash
Jan 26th
Philip Radvan has created an amazing resource of FREE game related .fla examples to download and use however you like! This one gets two thumbs up from me. There are some excellent scripts under the effects category which I have personally used (non-game related).
Go check it out here:
http://www.freeactionscript.com/game-scripts/
Here are the AS2 links: (there are a few as3 scripts on his site).
- Laser Hitting Solid Objects & Walls
- Projectile Weapons: Pistols, Shotguns & Machine Gun – v3
- Heat Seeking Missiles/Rockets/Torpedoes
- Lightning/Laser/Beam/Pulse Gun Effect
- Simple Laser Weapon
Effects Animated
- Simple Flashlight Effect
- Explosion Effect
- Sparkle Effect
- Random Blood Splatter Effect
- Smoke Effect – Particle Trailer
- Engine Trailer – Engine Particles
Effects Dynamic
- Endless Parallax Scrolling (star field)
- Bubbles Effect – Water, Beer, Liquid
- Realistic Water & Wave Effect
- Realistic Snow Fall & Snowflake Effect
- Realistic Dynamic Explosion Effect – Bitmap
- Particle Explosion – Bitmap
- Particle Explosion with Gravity – Bitmap
- Mouse Trailer – Bitmap
- Mouse Trailer with Gravity – Bitmap
- Realistic Smoke Trailer – Bitmap
- Realistic Vertical Smoke Trailer – Bitmap
- Shake Effect Script
- Apply Filters using ActionScript
- Realistic Smoke Effect
- Realistic Vertical Smoke Effect
- Dynamic Particle Explosion
Enemy AI Engine
- Multiple Enemies – Run Away & Follow Player
- Random Movement & Random Direction Change
- Simple Random Enemy Movement
Game Engine
- MovieClips Pushing MovieClips
- Parallax Movement Effect
- Car Movement: Acceleration, Braking, Turning & Reverse
- Smooth 4-way Player Movement with screen-wrap
- Multiple Key Press Detection
- Get Closest MovieClip/Object (Target)
Images/BitmapData
- Pixel Perfect Collision Detection
- Center Bitmap Inside MovieClip
- Attach Bitmap Image Dynamically
Interface
- Dynamic Tooltip
- Smooth Window Resize, Move and Hide
- Drag, Drop, and Snap Inventory System v2
- Game Minimap & Radar
Math
- MovieClip Rotation Around Point
- Rotate MovieClips toward Mouse
- Get Radians & Degrees
- Distance Between 2 MovieClip Objects
Security
Sound
How to Show Facebook Share Summary/Blurb/Description
Jan 25th
Facebook share image or description not showing up?
Blurb about your article not showing?
Make sure you include these meta tags in your shared/linked pages.
<meta name="title" content="Page Title" /> <meta name="description" content="Description about the page, which will appear as the description of the link in Facebook." /> <link rel="image_src" href="Image URL of the thumbnail to appear on Facebook." />
How To Round A Number In AS3
Jan 15th
Use below code to round up any number to the specific place.
function roundToNearest(roundTo:Number, value:Number):Number{
return Math.round(value/roundTo)*roundTo;
}
Essentially you divide by the number you want to round to which will give you a decimal number. Then round that (essentially removing the decimal) and multiple by the rounding number to get you right back to where you were.
Example:
roundToNearest(100, 1234);
1234/100 = 12.34
Math.round(12.34) //12
12*100 = 1200
