With options -e
, -n
, -p
, perl can do what grep/awk/sed can, what about ruby?
Let's take the result of ls -l
as input and process it with ruby
\ls -l | ruby -ne 'print if /^d/'
\ls -l | ruby -ne 'puts split(/\s+/).last if /^d/'
// blog is down for maintenance code | |
// MUST BE REMOVED! | |
function cwc_maintenance_mode() { | |
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) { | |
wp_die('Site is in progress; please come back soon.'); | |
} | |
} | |
add_action('get_header', 'cwc_maintenance_mode'); |
$(document).on "keydown", "#new_message textarea", (e) -> | |
$(this).parents("form").submit() if e.keyCode is 13 and (e.metaKey or e.ctrlKey) |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
UPDATE wp_options SET option_value = replace(option_value, 'OLD_SITE_URL', 'NEW_SITE_URL') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'OLD_SITE_URL','NEW_SITE_URL'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'OLD_SITE_URL', 'NEW_SITE_URL'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'OLD_SITE_URL', 'NEW_SITE_URL'); |
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
CTRL+X / Close the last open HTML tag | |
CTRL+X SPACE Create open/close HTML tags from the typed word | |
CTRL+X CR The same as CTRL+X SPACE but puts a new space in between | |
CTRL+X ! Insert HTML doctype | |
CTRL+X @ Insert CSS stylesheet | |
CTRL+X # Insert meta content-type meta tag | |
CTRL+X $ Load JavaScript document | |
For the following mappings, suppose that | |
you have typed "foo". |
I hereby claim:
To claim this, I am signing this object:
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.