Skip to content

Instantly share code, notes, and snippets.

View ProdigyView's full-sized avatar

Devin Dixon ProdigyView

View GitHub Profile
@ProdigyView
ProdigyView / gist:6766189
Created September 30, 2013 16:12
Implemented CORS for AngularJS and IE8 + IE9
function $HttpBackendProvider() {
this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) {
var params = [$browser, XHR, $browser.defer, $window.angular.callbacks, $document[0], $window.location.protocol.replace(':', '')]; /*orig xhr */
var param4ie = params.concat([msie,createHttpBackend.apply(this,params)]);
return (angular.ieCreateHttpBackend && angular.ieCreateHttpBackend.apply(this, param4ie)) ||
createHttpBackend.apply(this, params);
}];
}
function ieCreateHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, locationProtocol, msie, xhr) {
@ProdigyView
ProdigyView / angular_ie8_ajax
Created September 30, 2013 18:51
Possible example of using Jquery AJAX for CORS in IEfunction
ieCreateHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, locationProtocol, msie, xhr) {
if (!msie || msie > 9) return null;
return function (method, url, post, callback, headers, timeout, withCredentials) {
window.console.log(callback);
$.ajax({
url : url,
method : method,
success: function (respObj) {
completeRequest(callback, 200, respObj.responseText, 'Content-Type: ' + respObj.contentType);
@ProdigyView
ProdigyView / gist:6810998
Created October 3, 2013 14:43
Longer snippet of XDomain
var XHR = window.XMLHttpRequest || function() {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {}
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e4) {}
throw new Error("This browser does not support XMLHttpRequest.");
}, XDR = !window.msPerformance && isIE () != 10 && window.XDomainRequest || null;
/**
@ProdigyView
ProdigyView / gist:7947047
Created December 13, 2013 16:36
Which config do I modify extensions?
root@hhvm-ubuntu-12:/data/hhvm# find . -name "config.hdf"
./hphp/test/large_memory/config.hdf
./hphp/test/zend/config.hdf
./hphp/test/config.hdf
./hphp/test/quick/debugger/config.hdf
./hphp/test/frameworks/config.hdf
./hphp/test/slow/debugger/config.hdf
./hphp/test/slow/config.hdf
./hphp/test/slow/type_profiler/debugger/config.hdf
./hphp/test/vm-perf/config.hdf
@ProdigyView
ProdigyView / gist:8532148
Created January 21, 2014 00:30
Disqus OAuth Without Email
stdClass Object
(
[username] => Meeee2
[user_id] => xxxx3109
[access_token] => xxxxxab49d274c6ead22e792
[expires_in] => 2592000
[token_type] => Bearer
[state] =>
[scope] => read,write,email
[refresh_token] => xxxxxxxxx429ea4b9fb9071a5f523
@ProdigyView
ProdigyView / gist:8532375
Created January 21, 2014 00:55
Disqus JS Oauth String
window.location = "https://disqus.com/api/oauth/2.0/authorize/?client_id=0fyob7pEObeLaasAB4iT0QDUUstZYCaj4QrQJyZxyUdQg3itqSQzO4BKh7mj6LC2&scope=read,write,email&response_type=code&redirect_uri=" + window.location.href + "disqus/grant";
@ProdigyView
ProdigyView / gist:8532388
Created January 21, 2014 00:58
Disqus PHP OAuth
$oauth2token_url = 'https://disqus.com/api/oauth/2.0/access_token/';
$clienttoken_post = array(
"grant_type" => 'authorization_code',
"client_id" => PVConfiguration::getConfiguration('disqus') -> public_key,
"client_secret" => PVConfiguration::getConfiguration('disqus') -> private_key,
"redirect_uri" => 'http://'. HOST_DOMAIN .'/disqus/grant',
"code" => $_GET['code']
);
@ProdigyView
ProdigyView / gist:9835429
Created March 28, 2014 15:27
Is this the right function for video upload
//Write out src to console
console.log(src);
//The output of console.log(src)
src = function () {
var what, a = arguments, L = a.length, ax;
while (L && this.length) {
what = a[--L];
while ((ax = this.indexOf(what)) !== -1) {
this.splice(ax, 1);
-- CMAKE_PREFIX_PATH was missing, proceeding anyway
CMake Warning at CMake/HPHPSetup.cmake:62 (message):
chrpath not found, rpath will not be stripped from installed binaries
Call Stack (most recent call first):
third-party/CMakeLists.txt:18 (include)
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- system
@ProdigyView
ProdigyView / gist:9b8bd99fcc8942262886
Created May 17, 2014 18:20
Redoing cmake and make
root@cloud-server-05:/data/hhvm# rm -f CMakeCache.txt
root@cloud-server-05:/data/hhvm# cmake .
-- Performing Test IS_AARCH64
-- Performing Test IS_AARCH64 - Failed
-- CMAKE_PREFIX_PATH was missing, proceeding anyway
CMake Warning at CMake/HPHPSetup.cmake:62 (message):
chrpath not found, rpath will not be stripped from installed binaries
Call Stack (most recent call first):