This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
$list = new ExactTarget_List(); | |
$list->ListName = "Aaron's test list"; | |
$list->Description = "Aaron is now testing the API!"; | |
$exact_target = ExactTarget::instance('SOAP')->create($list); | |
} | |
catch (ExactTarget_Exception $e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
io = require('socket.io'), | |
// Map clients to sessions by IP | |
clients = {}; | |
var app = express.createServer(); | |
app.use(express.cookieParser()); | |
app.use(express.session({ secret: "keyboard cat" })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Escape special characters. | |
* | |
* See http://en.wikipedia.org/wiki/XML#Escaping | |
*/ | |
function ec_dreammail_escape_xml($string) { | |
$search = array('<', '>', '&', '"', "'"); | |
$replace = array('<', '>', '&', '"', '''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ec_dreammail_escape_xml($string) { | |
return htmlentities($string, ENT_QUOTES, 'UTF-8'); | |
} | |
function ec_dreammail_sanitize_xml($string) { | |
$ret = ""; | |
$length = strlen($string); | |
for ($i = 0; $i < $length; $i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get(request, params, callback) { | |
// Do stuff | |
} | |
get.require_auth; | |
get.params = { | |
token: true, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implementation of hook_block(). | |
*/ | |
function ec_channel_block($op = 'list', $delta = 0, $edit = array()) { | |
switch ($op) { | |
case 'list': | |
return array( | |
'products_and_events' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#model-versions ul li a').click(function() { | |
$('section.left article').animate({opacity: 0 }, 1000).load(this.href + " section.left article"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f; | |
Froogaloop( $('#player-player')[0] ).addEvent('ready', function() { | |
f = $f( $('#player-player')[0] ); | |
f.addEvent('finish', function() { | |
alert('finished! do something...'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function(global) { | |
var env = { | |
_deps: {}, | |
_ready: function() {}, | |
_change: function() {}, | |
// Add dependencies. | |
deps: function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function down_for_everyone($url) { | |
if (strpos($url, '://') === FALSE) { | |
$url = "http://$url"; | |
} | |
if (filter_var($url, FILTER_VALIDATE_URL)) { | |
$handle = curl_init($url); | |
curl_setopt($handle, CURLOPT_FOLLOWLOCATION, TRUE); |