{
"Image": {
"Width":800,
"Height":600,
"Title":"View from 15th Floor",
"Thumbnail":
{
"Url":"http:\/\/scd.mm-b1.yimg.com\/image\/481989943",
"Height": 125,
"Width": "100"
},
"IDs":[ 116, 943, 234, 38793 ]
}
}
Thanks Yahoo!
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.
Jump to
Elementary JSON
Labels:
array,
data,
hash,
javascript,
json
Coloured log output
Tail the log and pipe it through this:
#!/usr/bin/perl
use warnings;
use strict;
use Term::ANSIColor qw(color);
while( <> ) {
chomp;
s/\t/ /g;
(/ERROR|failed/) && do {
print( color( 'red' ). $_ .color( 'reset' )."\n" );
next;
};
(/WARN/) && do {
print( color( 'magenta' ). $_ .color( 'reset' )."\n" );
next;
};
(/succeeded/) && do {
print( color( 'green' ). $_ .color( 'reset' )."\n" );
next;
};
(/INFO/) && do {
print( color( 'yellow' ). $_ .color( 'reset' )."\n" );
next;
};
(/DEBUG/) && do {
print( color( 'blue' ). $_ .color( 'reset' )."\n" );
next;
};
print $_."\n";
}
#!/usr/bin/perl
use warnings;
use strict;
use Term::ANSIColor qw(color);
while( <> ) {
chomp;
s/\t/ /g;
(/ERROR|failed/) && do {
print( color( 'red' ). $_ .color( 'reset' )."\n" );
next;
};
(/WARN/) && do {
print( color( 'magenta' ). $_ .color( 'reset' )."\n" );
next;
};
(/succeeded/) && do {
print( color( 'green' ). $_ .color( 'reset' )."\n" );
next;
};
(/INFO/) && do {
print( color( 'yellow' ). $_ .color( 'reset' )."\n" );
next;
};
(/DEBUG/) && do {
print( color( 'blue' ). $_ .color( 'reset' )."\n" );
next;
};
print $_."\n";
}
Taking Screenshots in Mac OS X
http://guides.macrumors.com/Taking_Screenshots_in_Mac_OS_X
Shortcuts
* Command-Shift-3: Take a screenshot of the screen, and save it as a file on the desktop
* Command-Shift-4, then select an area: Take a screenshot of an area and save it as a file on the desktop
* Command-Shift-4, then space, then click a window: Take a screenshot of a window and save it as a file on the desktop
* Command-Control-Shift-3: Take a screenshot of the screen, and save it to the clipboard
* Command-Control-Shift-4, then select an area: Take a screenshot of an area and save it to the clipboard
* Command-Control-Shift-4, then space, then click a window: Take a screenshot of a window and save it to the clipboard
In Leopard, the following keys can be held down while selecting an area (via Command-Shift-4 or Command-Control-Shift-4):
* Space, to lock the size of the selected region and instead move it when the mouse moves
* Shift, to resize only one edge of the selected region
* Option, to resize the selected region with its center as the anchor point
Shortcuts
* Command-Shift-3: Take a screenshot of the screen, and save it as a file on the desktop
* Command-Shift-4, then select an area: Take a screenshot of an area and save it as a file on the desktop
* Command-Shift-4, then space, then click a window: Take a screenshot of a window and save it as a file on the desktop
* Command-Control-Shift-3: Take a screenshot of the screen, and save it to the clipboard
* Command-Control-Shift-4, then select an area: Take a screenshot of an area and save it to the clipboard
* Command-Control-Shift-4, then space, then click a window: Take a screenshot of a window and save it to the clipboard
In Leopard, the following keys can be held down while selecting an area (via Command-Shift-4 or Command-Control-Shift-4):
* Space, to lock the size of the selected region and instead move it when the mouse moves
* Shift, to resize only one edge of the selected region
* Option, to resize the selected region with its center as the anchor point
Labels:
mac,
picture,
printscreen,
screen,
screenshots
How to see the answers for free on Expert Exchange
http://www.experts-exchange.com
Solution:
Scroll down
Solution:
Scroll down
Labels:
community,
help,
productivity
Code folding in vi
All you ever wanted to know about code folding in vim, including keys: http://www.linux.com/archive/articles/114138
Config settings for code folding: http://smartic.us/2009/04/06/code-folding-in-vim/
Vim documentation for folding: http://www.vim.org/htmldoc/fold.html
Key concepts:
Config settings for code folding: http://smartic.us/2009/04/06/code-folding-in-vim/
Vim documentation for folding: http://www.vim.org/htmldoc/fold.html
There are six methods to select folds:
manual manually define folds
indent more indent means a higher fold level
expr specify an expression to define folds
syntax folds defined by syntax highlighting
diff folds for unchanged text
marker folds defined by markers in the text
Key concepts:
- To use the indent method you need to set the :tabstop correctly
- Syntax method requires the correct syntax files to be present
- zc -> close fold
- zo -> open fold
Labels:
code,
productivity,
text editor,
vi
How to talk to memcached
- telnet to the server (or localhost) on the right port
- type "flush_all" to invalidate the whole cache
- type "delete [key]" to invalidate a particular item
See also the memcache protocol
Subscribe to:
Posts (Atom)