Skip to content

Instantly share code, notes, and snippets.

View emertechie's full-sized avatar

Andrew Smith emertechie

View GitHub Profile
@emertechie
emertechie / gist:197c87d345500b7cdbba
Last active June 18, 2018 00:36
Using Cordova/PhoneGap Facebook SDK in an Ionic App
var module = angular.module('facebook', []);
module.constant('facebookInit', function(facebookAppID) {
var initialized = false;
return function($q) {
if (initialized) {
return;
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();
});
});
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 December 19, 2015 06:09
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 :/
public static class WcfClientWrapper
{
public static WcfClientWrapper<TClientInterface> Create<TClientInterface>(ChannelFactory<TClientInterface> channelFactory)
{
return new WcfClientWrapper<TClientInterface>(channelFactory);
}
}
public class WcfClientWrapper<TClientInterface> : IDisposable
{