Recent Notes

Displaying keyword search results 1 - 10
Created by voodoo on February 16, 2012 14:56:44    Last update: February 16, 2012 15:52:56
Shell functions are declared using this syntax: [ function ] name () compound-command [ redirectio... Example: function ll { ls -alF $* } Example 2: ll() { ls -alF $* } Shell functions can be exported to subshells with the -f switch: $ export -f ll However , I had problems logging in Ubuntu 11.10 after I added this to .profile : export -f ll
Created by voodoo on February 16, 2012 14:57:35    Last update: February 16, 2012 14:57:35
You can use either declare or typeset to list function definitions : To list all function names: declare -F To display a function definition: $ declare -f quote quote () { echo ... If you see a lot of functions with names starting with the underscore ( _ ) and wonder where they come from, they are created by the scripts in /etc/bash_completion.d/ .
Created by voodoo on February 16, 2012 13:35:38    Last update: February 16, 2012 13:35:57
The C shell allows you to define aliases with arguments: \!^ passes the first argument, \!* passes all arguments. Examples from http://unixhelp.ed.ac.uk : alias print 'lpr \!^ -Pps5' alias print 'lp... In ksh or bash you cannot define alias with arguments. Use function instead.
Created by Dr. Xi on February 06, 2012 12:14:11    Last update: February 07, 2012 15:39:35
Oracle sqlplus command line tools does not support command line editing out-of-the-box. But on Linux there's a handy utility that enables command line editing with any command line tool: rlwrap - readline wrapper. Install rlwrap: $ sudo apt-get install rlwrap Create a keywords file .sql.dict (optional, but convenient): false null true access add as asc begin by chec... It would be nice to add the tables names also. Create an alias for sqlplus (put it in .bashrc ): alias sqlplus='rlwrap -f $HOME/.sql.dict sqlplus'
Created by James on February 02, 2012 09:31:03    Last update: February 02, 2012 09:31:03
This is an example that adds a validation rule to jQuery validation: // add a custom method $.validator.addMethod("m...
Created by James on February 02, 2012 09:20:22    Last update: February 02, 2012 09:20:22
This example came from the jQuery validation documentation. The required rule can be used to validate a required selection box when you set the value of the first option to empty. <!DOCTYPE HTML> <html> <head> <scrip... The error message is the title since no error message is specified. A more fully defined validation check would look like this: $('#my-form').validate({ errorElement: "p", ...
Created by James on January 30, 2012 10:39:33    Last update: January 30, 2012 10:39:33
The qTip tooltip hides when mouse is off the target but on the tooltip itself. This makes it hard to click links in the tooltip - when you try to click the link, it disappears. Add the " fixed: true " flag to prevent it from disppearing: <script type="text/javascript"> $(function() { ...
Created by James on March 11, 2011 08:53:31    Last update: January 30, 2012 09:33:56
Both delegate and live allow you to bind event handlers to elements created in the future, but there are some differences: For .delegate , the event bubbles up to the element on which it is called. For .live , the event bubbles up to the root of the DOM tree, or, as of jQuery 1.4, optionally stop at a DOM element context. DOM traversal methods are not supported for finding elements to send to .live() . Rather, the .live() method should always be called directly after a selector. The opposite of .live is .die . The opposite of .delegate is .undelegate . Note: As of jQuery 1.7, the .live() method is deprecated . Use .on() to attach event handlers. Users of older versions of jQuery...
Created by James on January 26, 2012 21:23:56    Last update: January 26, 2012 21:23:56
In an HTML page, elements can overlap because of position styles. When there's an overlap, elements coming later in the HTML code are displayed on the top. This can be altered by specifying z-index in the CSS. Elements with higher z-index are placed on the top. However , z-index only works for elements that are not static positioned. Static positioned elements are always at the bottom compared to relative , fixed and absolute positioned elements. This is a test page: <!DOCTYPE html> <html> <head> <style t... Effects of z-index can be tested by adding it to the elements, for example: <div id="bg" class="big" style="z-index: 3"></div>...
Created by James on January 26, 2012 16:02:55    Last update: January 26, 2012 16:02:55
To append additional data to a form before Ajax form submit: var data = $(form).serializeArray(); data.push(...
Previous  1 2 3 4 5 6 7 8 9 10 Next