My GIT workflow

[WordPress Snippet] Get first image from content

1
2
3
4
5
6
7
8
9
10
11
12
13
function get_first_image_from_content($content) {
    $first_img = '';
    ob_start();
    ob_end_clean();
    $output = preg_match_all('//i', $content, $matches);
    $first_img = $matches [1] [0];

    if(empty($first_img)) {
        $first_img = get_template_directory_uri() . "/images/default.jpg";
    }

    return $first_img;
}

Connect to Cisco VPN from Mac OS X Lion (10.7)

Here are some instructions about using the Apple built-in client instead of the Cisco VPN software. Using the Apple built-in client will help ensure support as the Mac OS Evolves.

  1. Here’s how to use the Apple built-in client instead:
  2. Open System Preferences > Network
  3. Click the lock button to unlock it and make changes
  4. Click the plus sign above the unlocked lock button to add an interface.
  5. On the “Interface” drop-down select “VPN”
  6. On the “VPN Type:” drop-down select “Cisco IPSec”
  7. In the “Service Name:” text box create a memorable interface name such as “Your Company VPN”
  8. Click OK and then select this new interface
  9. Configure the interface with server address, vpn group and pre-shared key, username and password, etc.
In case you’ve an encrypted password you should be able to decode it here.

Older Entries »