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 Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't bind to service in /Users/edward/Sites/scratch/test.php on line 3 | |
PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't bind to service in /Users/edward/Sites/scratch/test.php:3 | |
Stack trace: | |
#0 /Users/edward/Sites/scratch/test.php(3): SoapClient->SoapClient('https://integce...', Array) | |
#1 {main} | |
thrown in /Users/edward/Sites/scratch/test.php on line 3 | |
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't bind to service in /Users/edward/Sites/scratch/test.php:3 | |
Stack trace: | |
#0 /Users/edward/Sites/scratch/test.php(3): SoapClient->SoapClient('https://integce...', 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
mysql Ver 15.1 Distrib 5.5.33a-MariaDB, for Linux (i686) using readline 5.1 |
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 _compare_dates($utc_date_str, $date_obj){ | |
$date1 = DateTime::createFromFormat(DateTime::ISO8601, $utc_date_str); | |
$date2 = clone($date_obj); | |
print "--------------------------------------------------------------------------------\n"; | |
var_dump("Non-UTC Date1:"); | |
var_dump($date1); | |
var_dump("Non-UTC Date2:"); | |
var_dump($date2); |
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 | |
$taxonomies = array( | |
array( | |
'name' => 'people', | |
'members' => array( | |
array('name' => 'Bill Clinton', 'cheater' => true), | |
array('name' => 'Barrack Obama', 'cheater' => false), | |
array('name' => 'John F Kennedy', 'cheater' => 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
$.ajaxSetup({ | |
beforeSend: function(xhr, settings) { | |
if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) { | |
// Send the token to same-origin, relative URLs only. | |
// Send the token only if the method warrants CSRF protection | |
// Using the CSRFToken value acquired earlier | |
xhr.setRequestHeader("X-CSRFToken", csrftoken); | |
} | |
} | |
}); |
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
// usage inside a vm: | |
var fooVM = function(){ | |
var self = this; | |
var resource_uri = ko.observable('/api/v1/foo/'); | |
var bar = ko.observable(1); | |
var baz = ko.observable(1); | |
ko.saveOnChange(self,['bar']); | |
} | |
var f = new fooVM(); | |
f.bar(2); // causes a PUT to /api/v1/foo/ |
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
class UserSpecificResourcesAuthorization(Authorization): | |
def read_list(self, object_list, bundle): | |
# This assumes a ``QuerySet`` from ``ModelResource``. | |
return object_list.filter(user=bundle.request.user) | |
def read_detail(self, object_list, bundle): | |
# Is the requested object owned by the user? | |
return bundle.obj.user == bundle.request.user | |
def create_list(self, object_list, bundle): |
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 YouTubeLink = function(text){ | |
var self = this; | |
self.url = ''; | |
self.findFirstUrl = function findFirstUrl( text ) | |
{ | |
var source = (text || '').toString(); | |
var url; | |
var matchArray; |
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 $root = $('html, body'); | |
$('a.smoothscroll').click(function() { | |
var href = $.attr(this, 'href'); | |
$root.animate({ | |
scrollTop: $(href).offset().top | |
}, 500, function () { | |
window.location.hash = href; | |
}); | |
return false; | |
}); |
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
class ApiAccessTest(ResourceTestCase): | |
def setUp(self): | |
super(ApiAccessTest, self).setUp() | |
pw = 'secret' | |
self.edward_user = User.objects.create_user(username='[email protected]', password=pw) | |
self.edward_user.save() | |
self.alan_user = User.objects.create_user(username='[email protected]', password=pw) | |
self.alan_user.save() |