1007Regenerate Thumbnails in WordPress

Option 1

The Regenerate Thumbnails Plug-in.

Option 2

wp command line tool

Regenerate all images, without confirmation.

wp media regenerate --yes

Regenerate thumbnails only.

wp media regenerate --image_size=thumbnail

Error

Error: Error establishing a database connection.

When working on localhost, use 127.0.0.1 instead of localhost in wp.config

define( 'DB_HOST', '127.0.0.1' );

978Changing default Screenshot Form in OSX

Default format is PNG, change it to any of the following:

defaults write com.apple.screencapture type JPG
defaults write com.apple.screencapture type TIFF
defaults write com.apple.screencapture type GIF
defaults write com.apple.screencapture type PDF
defaults write com.apple.screencapture type PNG

First encountered here.

334Combining Images with UIImage & CGContext – (Offscreen drawing)

In Cocoa NSImage has a lockFocus method, that allows to draw images offscreen and combine them into one.
[img lockFocus];
//...
[img unlockFocus];
On the iPhone, UIImage lacks the lockFocus methods, instead the following:
// Create new offscreen context with desired size
UIGraphicsBeginImageContext(CGSizeMake(64.0f, 64.0f));

// draw img at 0,0 in the context
[img drawAtPoint:CGPointZero];

// draw another at 0,0 in the context, maybe with an alpha value
[another drawAtPoint:CGPointZero];

// ... and other operations

// assign context to UIImage
UIImage *outputImg = UIGraphicsGetImageFromCurrentImageContext();

// end context
UIGraphicsEndImageContext();

175Curling Images at Twitter

curl -F ‘image=@test.png;type=image/png’ -H ‘Expect:’ -u username:password http://twitter.com/account/update_profile_background_image.xml hmm nice. the logical thing to do. instead of text messages, send images… update: turning tiling on. curl -F ‘image=@test.png;type=image/png’ –F ’tile=true’ -H ‘Expect:’ -u username:password http://twitter.com/account/update_profile_background_image.xml second -F flag creates second form field. update: same applies to user profile image curl -F ‘image=@icon.png;type=image/png’ -H ‘Expect:’ -u username:password http://twitter.com/account/update_profile_image.xml update: absolute image paths curl -F ‘image=@/Users/x/Desktop/icon.png;type=image/png’ -H ‘Expect:’ -u username:password http://twitter.com/account/update_profile_image.xml there seems to be a bug in the max shell object, preventing cd to work. it also does not like relative paths (~)…