Skip to content

Instantly share code, notes, and snippets.

View bshaffer's full-sized avatar

Brent Shaffer bshaffer

View GitHub Profile
if(request.getMessage().equalsIgnoreCase("completed")) {
try {
/* Connect to the URL */
URL url = new URL( request.getData_url() );
URLConnection connection = url.openConnection();
/* Attach the Security Header (X-WSSE) */
connection.addRequestProperty("X-WSSE", getSecurityHeader( "<your user name>","<your shared secret>" ));
connection.setDoOutput(false);
@bshaffer
bshaffer / Smart Links.js
Created June 1, 2012 22:07
Colloquy Smart Linking Plugin
@bshaffer
bshaffer / gist:1648811
Created January 20, 2012 18:23
Introducing Markdown for Developer Connection Content and Comments

Have you ever pasted application code into a forum thread and saved it, only to see your comment broken and garbled when you refresh the page? This may have happened to you, and as developers it is imperative that our code samples are properly formatted.

Markdown is a lightweight markup language that corrects this frustration. It is easy to read and easy to write, ensuring your content is formatted properly. For those not familiar, spend some time going over the official Markdown Syntax Guide at Daring Fireball. If you are the Learn-By-Doing type, check out the Web Dingus. As an example, we will demonstrate the main syntactical elements used by most developers, which are bold, italics, links, lists, and code blocks.

I _really_ like that [Developer Connection](http://developer.omniture.com) supports `Markdown`.  I can now post rich code like this!

$response = $api->sendR

#!/usr/local/bin/php
<?php
if (count($argv) < 2) {
exit('p4-sync repository [branch or "trunk"]');
}
$repo = $argv[1];
$cmd = 'p4 sync //depot/%s/...';
if (count($argv) > 2) {
Script: Integration Create Test Script
Array
(
[0] => Array
(
[functionName] => DataWarehouse.CreateSegment
[hadErrors] => true
[result] => This report suite is not configured for access to Data Warehouse.
)
<?php
class SN_SoapClient extends SoapClient
{
// ...
protected function fixArgs($function_name, $arguments)
{
// get the arguments for the function
$parameters = array_flip($this->getFunctionArguments($function_name));
<?php
namespace Acme\DemoBundle\Controller;
use Acme\DemoBundle\Documents\User;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Configuration;
use Doctrine\MongoDB\Connection;
use Doctrine\Common\Annotations\AnnotationReader;
Category:
womenswear_root:
name: Womenswear
children:
Womens_Fashion:
name: Fashion
Womens_Beauty:
name: Beauty
Womens_Accessories:
name: Accessories
@bshaffer
bshaffer / config.yml
Created May 17, 2011 16:19
Config Importing Parameters.ini
imports:
- { resource: parameters.ini }
doctrine:
dbal:
default_connection: default
connections:
default:
driver: %database_driver%
host: %database_host%
@bshaffer
bshaffer / sfMyThemeThemeConfiguration.class.php
Created April 28, 2011 19:42
Example Theme Configuration
<?php
class sfMyThemeThemeConfiguration extends sfThemeConfiguration
{
protected
$theme = 'my-theme';
public function filesToCopy()
{
$files = array(