Recent Notes

Displaying notes 61 - 70
Created by Dr. Xi on April 16, 2014 15:40:09    Last update: April 16, 2014 15:40:09
The "with" statement makes it easy to open a file, use it then finally close it, without explicitly coding with a " try...finally " block. Example: >>> import yaml >>> with open("app.yaml") as f:... More info: Understanding Python's "with" statement
Created by voodoo on April 15, 2014 16:25:09    Last update: April 15, 2014 16:25:09
Example session for Lua string concatenation: > a = { 'a', 'b' } > for i, v in pairs(a) d...
Created by voodoo on April 15, 2014 16:20:36    Last update: April 15, 2014 16:20:36
For arrays with numerical indices: > a = { 'a', 'b' } > =#a 2 > =table.g... However, the # operator or table.getn does not count elements with string indices: > a['a'] = 1 > a['b'] = 2 > return #a ... Further, the pairs function does not list keys accessible made available via setmetatable : > setmetatable(a, {__index = function(table, k...
Created by Dr. Xi on April 15, 2014 12:03:45    Last update: April 15, 2014 12:03:45
To show the file type identified by vim for the file you are currently editing, type " :set filetype " in vim command. From vim Help, this is how vim identifies file type: Detail: The ":filetype on" command will load one o...
Created by Dr. Xi on April 15, 2014 11:32:50    Last update: April 15, 2014 11:32:50
You can set (shell) environment variables $VIM and $VIMRUNTIME and vim will honor them. But there are default values that vim takes if you don't set them. Here are some methods to find the default values. Enter :verson vim command. It displays all compilation flags used to compile vim, including "fall-back for $VIM". Enter :set runtimepath vim command (or shorthand :set rtp ) Run this command in shell: vim -e -T dumb --cmd 'exe "set t_cm=\<C-M>"|echo $...
Created by voodoo on April 11, 2014 14:12:29    Last update: April 11, 2014 14:12:29
There are three ways to list the network interfaces: $ ip link show $ netstat -i $ ifconfig -a
Created by James on April 03, 2014 21:27:08    Last update: April 03, 2014 21:27:08
This selector omits the first row of a table: $('#my-table tr:not(:first)')
Created by James on February 03, 2014 14:38:30    Last update: February 03, 2014 14:38:30
IE 10 no longer support conditional comments like: <!--[if IE 8]> <p>Welcome to Internet Explorer ... So other hacks are necessary when you want to target specific CSS to IE10 or IE11. The following hack was confirmed to work for IE10 & IE11: <style type="text/css"> label.ie { displa... Links: Moving IE specific CSS into @media blocks IE 10 Specific Styles
Created by James on February 01, 2014 10:19:03    Last update: February 01, 2014 10:19:03
This example selects a previous element that has class has-error but is not form-group : $('#example').prev('.has-error:not(.form-group)')
Created by voodoo on January 16, 2014 13:01:19    Last update: January 16, 2014 13:01:19
To ask curl to ignore system proxy (" --dump-header - " is not needed): $ curl --dump-header - --proxy '' http://www.googl...
Previous  2 3 4 5 6 7 8 9 10 11 Next