Android SDK r10下载地址
由于developer.android.com无法连接,但实际的地址其实是可以连接上的,记录一下。
| Platform | Package | Size | MD5 Checksum |
|---|---|---|---|
| Windows | android-sdk_r10-windows.zip | 32832260 bytes | 1e42b8f528d9ca6d9b887c58c6f1b9a2 |
| installer_r10-windows.exe (Recommended) | 32878481 bytes | 8ffa2dd734829d0bbd3ea601b50b36c7 | |
| Mac OS X (intel) | android-sdk_r10-mac_x86.zip | 28847132 bytes | e3aa5578a6553b69cc36659c9505be3f |
| Linux (i386) | android-sdk_r10-linux_x86.tgz | 26981997 bytes | c022dda3a56c8a67698e6a39b0b1a4e0 |
Magento定制主菜单
- 此篇文章讲述了如何定制您的Magento Store的菜单
- 使用CSS隐藏主菜单项
Magento转换URL
Get the base url
1 2 3 4 5 | Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); // default Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); |
Get the skin url
1 | $this->getSkinUrl(); |
@font-face support across browsers
EOT: Internet Explorer
The EOT (Embedded Open Type) format typefaces are supported in all versions of Internet Explorer.
TTF: Safari, Opera, Chrome, and Firefox
Safari version 3.2 onwards, Opera version 10 onwards, Firefox version 3.5 onwards, and all versions of Chrome support the TTF (TrueType Format) for typefaces in @font-face.
OTF: Safari, Opera, Chrome, and Firefox
Similarly to the TrueType Format, OTF (OpenType Format) is supported by Safari version 3.2 onwards, Opera version 10 onwards, Firefox version 3.5 onwards, and all versions of Chrome support the TTF (TrueType Format) for typefaces in @font-face.
SVG: iPhone and Chrome
The SVG (Scalable Vector Graphics format) is supported by the iPhone and Chrome browsers. SVG font files are specially formatted .svg files that contain vector graphics for each glyph and character of the typeface it represents, allowing for easy scalability.
WOFF: Firefox
The WOFF (Web Open Font Format) is currently supported by Firefox, but is in the process of becoming a standard for font formats across all major browsers, including those by Opera, Microsoft, and Mozilla.
Magento定制Sidebar
删除Paypal Partner
<remove name=”paypal.partner.right.logo” /> <!–paypal logo–>
删除Community Poll
<remove name=”right.poll”/>
<remove name=”left.poll”/>
删除Tags
<remove name=”tags_popular”/>
删除Compare Products
<remove name=”catalog.compare.sidebar” /> <!–product compare–>
删除Reorder
<remove name=”sale.reorder.sidebar”/>
删除WishList
<remove name=”wishlist_sidebar”/>
删除Dog
<remove name=”left.permanent.callout” /> <!–the dog–>
删除Back to School
<remove name=”right.permanent.callout” /> <!–back to school–>
删除购物车
<remove name=”cart_sidebar” /> <!–cart sidebar–>
删除recently viewed product
<remove name=”left.reports.product.viewed” /> <!–recently viewed prod–>
<remove name=”right.reports.product.viewed” /> <!–recently viewed prod–>
删除recently compared product
<remove name=”right.reports.product.compared” /> <!–recently compared prod–>
Drupal 测试邮件发送
Reroute Email模块可以帮助你进行邮件发送的测试。
This module intercepts all outgoing emails from a Drupal site and reroutes them to a predefined configurable email address.
This is useful in case where you do not want email sent from a Drupal site to reach the users. For example, if you copy a live site to a test site for the purpose of development, and you do not want any email sent to real users of the original site. Or you want to check the emails sent for uniform formatting, footers, …etc.
This is also a good demonstration of what hook_mail_alter(), available in Drupal 5.x and later, can do.
jQuery fadeIn() & fadeOut(): Problems in Internet Explorer
I’ve noticed that when I use the jQuery .fadeIn() or .fadeOut() method I see ugly pixelated text in Internet Explorer after the animation has completed. This seems to be related to an issue with an IE specific style filter called clearType. To solve the problem, you need to remove the clearType filter after your jQuery element has faded in. There are a few ways to do this:
Preview / Sample / Demonstration
3 Ways to Fix The Issue
1. Add a Background Color
Set a background color with CSS on the element that is fading in or out. This is the most basic way to solve the problem.
2. Remove the clearType Filter
After fading in an element you can add this simple callback function to fix the bug.
1 2 3 | $('#fadingElement').fadeIn(2000, function(){ $(this).css('filter',''); }); |
3. Use a Custom fadeIn/Out Method
This method serve’s as a replacement for the built-in fadeIn() & fadeOut() methods for jQuery.
After you add this method to your JavaScript, change your ‘fadeOut’ to ‘customFadeOut’ and your ‘fadeIn’ to ‘customFadeIn’. See a sample of this method on the demo page. Thanks to Benjamin Novakovic for writing this jQuery plugin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | (function($) { $.fn.customFadeIn = function(speed, callback) { $(this).fadeIn(speed, function() { if(jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; $.fn.customFadeOut = function(speed, callback) { $(this).fadeOut(speed, function() { if(jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; })(jQuery); |
Ugly Transitions on Animated Elements
When you animate anything in IE there is an ugly transition effect that occurs before the fix is applied. There’s no way to prevent or fix clearType while the fade occurs. A work-around is to fade something else, like a <div> on top that fades in, rather than your text content.
Advanced Scenarios
There are more IE related issues that people have mentioned seeing in advanced setups as well.
I found that the answer was to set the z-index. I have a stack of absolutely positioned divs and wanted to fade between them. The only way I could get IE8 to handle the fades nicely was to set the z-index of the element to be faded in higher than the element to be faded out i.e.:
A demonstration for Al’s fix has been added to the demo page
原文出处:http://www.kevinleary.net/jquery-fadein-fadeout-problems-in-internet-explorer/
Drupal 7常用theme hooks
file_link
Returns HTML for a link to a file.
html_tag
Returns HTML for a generic HTML tag with attributes. This can often be too generic a theme hook to use, but is really useful for adding a tag to the of a document or for theming a tag inside a render element.
image
Returns HTML for an image. image_style Returns HTML for an image using a specific image style.
item_list
Returns HTML for a list of items which can optionally be nested.
links
Returns HTML for a list of links (cannot be nested).
more_link
Returns HTML for a more link, often used on blocks.
pager
Returns HTML for a pager query element, a list of pages for result sets too long for one page.
progress_bar
Returns HTML for an indicator showing a task’s progress.
table
Returns HTML for a table.
username
Returns HTML for a username.
user_list
Returns HTML for a list of users.
user_picture
Returns HTML for a picture configured for the user’s account.
MySQL 修改密码
1.Set the new root password
1 | $ mysqladmin -u root password NEWPASSWORD |
2.Change the root password
2 | $ mysqladmin -u root -p'oldpassword' password newpass |
3.Change MySQL password for other user
3 | $ mysqladmin -u vivek -p oldpassword password newpass |
Drupal t函数
Drupal supports translation is largely through the t() function.
The function takes an optional second argument。
1 2 | $values = array('@user' => $username); print t('Welcome, @user', $values); |
If the placeholder begins with at sign @, then before it inserts the value, Drupal sanitizes the value using its internal check_plain() function.
1 2 | $values = array('!url' => 'http://example.com'); print t('The website can be found at !url', $values); |
If the placeholder begins with exclamation mark !, then it will be entered with no escaping. We can do this safely only because we already know the value of URL.
1 2 | $values = array('%color' => 'blue'); print t('My favorite color is %color.', $values); |
If the placeholder begins with the percent sign %, it tells Drupal to escape the code and to mark it as emphasized. (The content will be embedded in the em tag)