Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Smith emertechie

View GitHub Profile
@emertechie
emertechie / gist:197c87d345500b7cdbba
Last active Jun 18, 2018
Using Cordova/PhoneGap Facebook SDK in an Ionic App
View gist:197c87d345500b7cdbba
var module = angular.module('facebook', []);
module.constant('facebookInit', function(facebookAppID) {
var initialized = false;
return function($q) {
if (initialized) {
return;
View ParseConflictHelperFn.js
Parse.Cloud.beforeSave("TestObject", function(request, response) {
ensureNotStale(request.object, response.error, function() {
// Update is not stale. Add any other code here
console.log('doing some work here with the fresh object');
response.success();
});
});
View SimulateParseConflictError.js
define([
'parse'
], function() {
describe('Quick & Dirty Parse Conflict Test', function() {
var async = new AsyncSpec(this);
var TestObject;
beforeEach(function() {
TestObject = Parse.Object.extend("TestObject");
@emertechie
emertechie / WcfClientWrapper.cs
Last active Dec 19, 2015
WcfClientWrapper. Based on code picked up from http://stackoverflow.com/questions/573872/what-is-the-best-workaround-for-the-wcf-client-using-block-issue Creating gist so I don't have to recreate this everytime I do any WCF :/
View WcfClientWrapper.cs
public static class WcfClientWrapper
{
public static WcfClientWrapper<TClientInterface> Create<TClientInterface>(ChannelFactory<TClientInterface> channelFactory)
{
return new WcfClientWrapper<TClientInterface>(channelFactory);
}
}
public class WcfClientWrapper<TClientInterface> : IDisposable
{
You can’t perform that action at this time.