Wednesday, August 29, 2012

BootStrap from Twitter


Twitter BootStrap
What is BootStrap?
It a front-end open source toolkit for rapidly developing web applications. It is a collection of CSS (CSS3) and HTML(HTML5) conventions.
It uses some of the latest browser techniques to provide you with stylish typography, forms, buttons, tables, grids, navigation and everything else you need in a super tiny (only 6k with gzip) resource.

Technologies used in it?
HTML/HTML5, CSS/CSS3, jQuery (but not limited to these J )
  • By nerds, for nerds! Built at Twitter by @mdo and @fat, Bootstrap utilizes LESS CSS, is compiled via Node, and is managed through GitHub to help nerds do awesome stuff on the web.
  • Made for everyone! Bootstrap was made to not only look and behave great in the latest desktop browsers (as well as IE7!), but in tablet and smartphone browsers via responsive CSS as well.
Benefits?
  • A clean and uniform solution to the most common, everyday interface tasks developers come across
  •  Light weight,   Easy & faster development
  • Well tested across OSs & Browsers ( ie6 users please excuse J ) 
I want to try!
·         Site : http://twitter.github.com/bootstrap/
·         Download : http://twitter.github.com/bootstrap/
·         Complete Documents : http://twitter.github.com/bootstrap/scaffolding.html

Note, the above sites/links itself built in bootstrap.

References:

Thursday, May 10, 2012

YUIDoc JavaScript documentation generator released

Today was the official release of the new YUIDoc JavaScript documentation generator. YUIDoc is a Node.js application that generates API documentation from comments in source, using a syntax similar to tools like Javadoc and Doxygen. YUIDoc is currently powering the API documentation for YUI and has been actively updated over the last year.


YUIDoc provides:
  • Live previews YUIDoc includes a standalone doc server, making it trivial to preview your docs as you write.
  • Modern markup YUIDoc’s generated documentation is an attractive, functional web application with real URLs and graceful fallbacks for spiders and other agents that can’t run JavaScript.
  • Wide language support YUIDoc was originally designed for the YUI project, but it is not tied to any particular library or programming language. You can use it with any language that supports /* */ comment blocks.

See the blog post for more details:
http://www.yuiblog.com/blog/2012/05/09/yuidoc-0-3-0-is-official/

Monday, May 7, 2012

Gmail Keyboard Shortcuts


Keyboard shortcuts help you save time by allowing you to never take your hands off the keyboard to use the mouse. You'll need a Standard 101/102-Key or Natural PS/2 Keyboard to use the shortcuts.

To turn these case-sensitive shortcuts on or off:
  1. Click the gear icon in the upper right, then select Settings.
  2. Choose the option next to "Keyboard shortcuts" to turn them on. You can also enable shortcuts automatically by going to http://mail.google.com/mail/?kbd=1

Shortcut Key Definition Action
c Compose Allows you to compose a new message. + c allows you to compose a message in a new window.
/ Search Puts your cursor in the search box.
k Move to newer conversation Opens or moves your cursor to a more recent conversation. You can hit to expand a conversation.
j Move to older conversation Opens or moves your cursor to the next oldest conversation. You can hit to expand a conversation.
n Next message Moves your cursor to the next message. You can hit to expand or collapse a message. (Only applicable in 'Conversation View.')
p Previous message Moves your cursor to the previous message. You can hit to expand or collapse a message. (Only applicable in 'Conversation View.')
o or Open Opens your conversation. Also expands or collapses a message if you are in 'Conversation View.'
u Return to conversation list Refreshes your page and returns you to the inbox, or list of conversations.
e Archive Archive your conversation from any view.
m Mute Archives the conversation, and all future messages skip the Inbox unless sent or cc'd directly to you. Learn more.
x Select conversation Automatically checks and selects a conversation so that you can archive, apply a label, or choose an action from the drop-down menu to apply to that conversation.
s Star a message or conversation Adds or removes a star to a message or conversation. Stars allow you to give a message or conversation a special status.
+ Mark as important Helps Gmail learn what's important to you by marking misclassified messages. (Specific to Priority Inbox)
- Mark as unimportant Helps Gmail learn what's not important to you by marking misclassified messages. (Specific to Priority Inbox)
! Report spam Marks a message as spam and removes it from your conversation list.
r Reply Replies to the message sender. + r allows you to reply to a message in a new window. (Only applicable in 'Conversation View.')
a Reply all Replies to all message recipients. +a allows you to reply to all message recipients in a new window. (Only applicable in 'Conversation View.')
f Forward Forwards a message. + f allows you to forward a message in a new window. (Only applicable in 'Conversation View.')
Escape from input field Removes the cursor from your current input field.
+ sSave draft Saves the current text as a draft when composing a message. Hold the key while pressing s and make sure your cursor is in one of the text fields -- either the composition pane, or any of the To, CC, BCC, or Subject fields -- when using this shortcut.
# Delete Moves the conversation to Trash.
l Label Opens the Labels menu to label a conversation.
v Move to Moves the conversation from the inbox to a different label, Spam or Trash.
+ i Mark as read Marks your message as 'read' and skip to the next message.
+ u Mark as unread Marks your message as 'unread' so you can go back to it later.
[ Archive and previous Removes the current view's label from your conversation and moves to the previous one.
] Archive and next Removes the current view's label from your conversation and moves to the next one.
z Undo Undoes your previous action, if possible (works for actions with an 'undo' link).
+ n Update current conversation Updates your current conversation when there are new messages.
q Move cursor to chat search Moves your cursor directly to the chat search box.
y Remove from Current View* Automatically removes the message or conversation from your current view.
  • From 'Inbox,' 'y' means Archive
  • From 'Starred,' 'y' means Unstar
  • From 'Trash,' 'y' means Move to inbox
  • From any label, 'y' means Remove the label
* 'y' has no effect if you're in 'Spam,' 'Sent,' or 'All Mail.'
. Show more actions Displays the 'More Actions' drop-down menu.
+ Opens options in Chat
  • + moves from edit field in your chat window to select the 'Video and more' menu
  • Next, press to select the emoticon menu
  • Press to open the selected menu
? Show keyboard shortcuts help Displays the keyboard shortcuts help menu within any page you're on. (Note: Typing ? will display the help menu even if you don't have keyboard shortcuts enabled)
k Move up a contactMoves your cursor up in your contact list
jMove down a contactMoves your cursor down in your contact list
o or
OpenOpens the contact with the cursor next to it.
uReturn to contact list viewRefreshes your page and returns you to the contact list.
eRemove from Current GroupRemoves selected contacts from the group currently being displayed.
xSelect contactChecks and selects a contact so that you can change group membership or choose an action from the drop-down menu to apply to the contact.
Escape from input fieldRemoves the cursor from the current input
#DeleteDeletes a contact permanently
lGroup membershipOpens the groups button to group contacts
zUndoReverses your previous action, if possible (works for actions with an 'undo' link)
.Show more actionsOpens the "More actions" drop-down menu.



Combo-keys - Use the following combinations of keys to navigate through Gmail.
Shortcut Key Definition Action
then Send message After composing your message, use this combination to send it automatically. (Supported in Internet Explorer and Firefox, on Windows.)
y then o Archive and next Archives your conversation and moves to the next one.
g then a Go to 'All Mail' Takes you to 'All Mail,' the storage site for all mail you've ever sent or received (and have not deleted).
g then s Go to 'Starred' Takes you to all conversations you have starred.
g then c Go to 'Contacts' Takes you to your Contacts list.
g then d Go to 'Drafts' Takes you to all drafts you have saved.
g then l Go to 'Label' Takes you to the search box with the "label:" operator filled in for you.
g then i Go to 'Inbox' Returns you to the inbox.
g then t Go to 'Sent Mail' Takes you to all mail you've sent.
* then a Select all Selects all mail.
* then n Select none Deselects all mail.
* then r Select read Selects all mail you've read.
* then u Select unread Selects all unread mail.
* then s Select starred Selects all starred mail.
* then t Select unstarred Selects all unstarred mail.

Tuesday, November 22, 2011

Recover deleted file on Linux


If you deleted a file on linux based OS accidentally, and want to recover it, lsof command may help you.

lsof is a Linux tool which can show open files and network connections, and even recover deleted files.

If you have ever deleted a file by mistake; been clearing up log files, or just used rm without thinking, there is a way of recovering that deleted file. For example, to recover a missing access_log used by Apache you can search for it via this command:

$ lsof | grep access_log

which output will be similar to:

httpd 26120 apache 42w REG 253,0 5852 12222531 /apachelogs/access_log (deleted)

The key word to look for here is deleted in brackets. The good news is a process (26120) still has the file open and without this process keeping the file open we would have lost the file permanently. So, with the Apache daemon helping us out we can view the missing info by looking inside the proc filesystem, the process id (26120), and finally in the file descriptor (fd):

$ cat /proc/26120/fd/42

This outputs the contents of my deleted access_log which shows the data is still there. All you need to do now is simply redirect the contents back to /apachelogs/access_log, like this:

$ cat /proc/26120/fd/42 > /apachelogs/access_log

Now you have recovered your access_log with all the data back to its original location. (You should also restart Apache). lsof can do much more, however, this is one example which could save the day.

Feel free to share other useful example of lsof here (in comments).

Tuesday, September 20, 2011

Hacking Firefox : Useful Addons

After using firefox for almost 8 years, I think that there are so many firefox Addons without which my life wouldn't be so comfortable. In the progression of Hacking firefox to make browsing easy, here are few most used Firefox addons:
  • Firebug : Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
  • YSlow : YSlow analyzes web pages and why they're slow based on Predefined & Custom rules for high performance web sites.
  • Pagespeed : Very Similar to YSlow provided by Google.
  • ColorZilla : a color picker, which is used to find any color code just by hovering mouse.
  • Xmarks Sync : is a bookmarking add-on. Keep your bookmarks, passwords and open tabs backed up and synchronized across computers and browsers.
  • FoxClocks : FoxClocks lets you keep an eye on the time around the world - or just your local time - by putting small clocks in your statusbar.
  • AdBlock Plus : Annoyed by adverts? Troubled by tracking? Bothered by banners? Install Adblock Plus now to regain control of the internet and change the way that you view the web.
  • ChatZila : A clean, easy to use and highly extensible Internet Relay Chat (IRC) client.
  • Cookies Manager+ : Cookie manager that allows view, edit and create new cookies. It also allows show extra information about cookies and allows edit multiple cookies at once, as well as backup/restore them.
  • JS Switch : Add a toolbar button or an option in Tool menu to toggle JavaScript.

Friday, August 26, 2011

!(How to Kill PHP Performance)

  1. Wrap sting in single quote instead of double quote As PHP searches variable inside "..." but not in '...'
  2. echo is faster than print print returns valus on success which degrades the performance.
  3. Use echo‘s multiple parameters (or stacked) instead of string concatenation
  4. Use pre-calculations set the maximum value for your for-loops before and not in the loop. ie: for ($x=0; $x < count($array); $x)
  5. Unset or null your variables to free memory, especially large arrays.
  6. Use require() instead of require_once() where possible
  7. Use full paths in includes and requires less time spent on resolving the OS paths.
  8. Close your database connections when you’re done with them.
  9. Avoid use of @ Error suppression with @ is very slow.
  10. Methods in derived classes run faster than ones defined in the base class.
  11. Use pre-increment over post-increment
  12. Use strict code, avoid suppressing errors, notices and warnings thus resulting in cleaner code and less overheads.
  13. Avoid PHP scripts (unless cached) compilation on the fly every time you call them. Install a PHP caching product (such as APC, memcached or eAccelerator or Turck MMCache) to typically increase performance by 25-100% by removing compile times.
  14. Try to use static pages 
    PHP scripts are be served at 2-10 times slower by Apache httpd than a static page. 
  15. else if statements are faster than select statements aka case/switch.
  16. In OOP, declare a method as static, if it can be . Speed improvement is by a factor of 4.
  17. $row[’id’] is 7 times faster than $row[id], because if you don’t supply quotes it has to guess which index you meant, assuming you didn’t mean a constant.
  18. Use 
    $_SERVER[’REQUEST_TIME’]
    instead of time() or microtime() when script starts
  19. When parsing with XML in PHP try xml2array, which makes use of the PHP XML functions
  20. Use isset where possible in replace of strlen. (ie: if (strlen($foo) < 5) { echo “Foo is too short”; } vs. if (!isset($foo{5})) { echo “Foo is too short”; } ).
  21. Incrementing an object property (eg. $this->prop++) is 3 times slower than a local variable.
  22. Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one.
  23. Use ip2long() and long2ip() to store IP addresses as integers instead of strings.
  24. When using header(‘Location: ‘.$url); remember to follow it with a die(); as the script continues to run even though the location has changed or avoid using it all together where possible.
  25. Just declaring a global variable without using it in a function slows things down. PHP checks If it exists or now.
  26. Not everything has to be OOP, often it is just overhead, each method and object call consumes a lot of memory.
  27. Make use of the countless predefined functions of PHP, don’t attempt to build your own as the native ones will be far quicker; if you have very time and resource consuming functions, consider writing them as C extensions or modules.
  28. Profile your code. A profiler shows you, which parts of your code consumes how many time. The Xdebug debugger already contains a profiler. Profiling shows you the bottlenecks in overview

Wednesday, August 17, 2011

!(How to Kill MySQL Performance)

LinkWithin

Related Posts with Thumbnails