Skip to content

Instantly share code, notes, and snippets.


Noah Durell ndurell

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ndurell on github.
  • I am ndurell ( on keybase.
  • I have a public key ASD0kOZ-goL-15d8OGtpW-7l2DFasfT6Zbm_yIgd9T4NrQo

To claim this, I am signing this object:

ndurell / github.swift
Created Nov 27, 2018
point free caching github api example
View github.swift
let cachingGitHub = CachingGitHub()
struct GitHub {
var latestRepos: () -> [Repo] = { return cachingGitHub.latestRepos }
var fetchRepos: (@escaping (Result<[Repo], APIError>) -> Void) -> Void = cachingGitHub.fetchRepos
class CachingGitHub {
var latestRepos = [Repo]()
func fetchRepos(completion: @escaping (Result<[Repo], APIError>) -> Void) {
ndurell / example.swift
Created Aug 25, 2017
Weak self example
View example.swift
create(image: image) { [weak self] key, error in
guard let `self` = self else {
if let error = error {
self.completion?(nil, error)
self.completion = nil
ndurell / stuff.swift
Created Apr 26, 2017
Instructions for reading a file from the bundle
View stuff.swift
let path : URL = Bundle.main.path(forResource: "scifi-novels", ofType: "json").flatMap {
URL.init(fileURLWithPath: $0)
let data = try! Data(contentsOf: path)
let json = try! JSONSerialization.jsonObject(with: data) as? [String: Any]
ndurell /
Last active May 23, 2016
Gist detail how we use Fused Location Provid

Build google api client:

m_googleApiClient = builder.

The location request looks like this:

ndurell / AppDelegate.m
Last active Aug 29, 2015
How to turn on logging.
View AppDelegate.m
// ExampleAppDelegate.m
// MyApp
#import "ExampleAppDelegate.h"
#import "SessionM.h"
@implementation ExampleAppDelegate
ndurell /
Last active Aug 29, 2015
Below is a sample custom achievement. It uses an alert dialog to display the achievement information. This is meant to illustrate how to make custom achievement API calls and shouldn't be used in a real app.
import android.content.DialogInterface;
import android.util.Log;
import com.sessionm.api.AchievementData;
import com.sessionm.api.AchievementActivity;
import com.sessionm.api.AchievementActivityIllegalStateException;
import com.sessionm.api.SessionM;
ndurell / SessionM.xml
Created Feb 18, 2014
This gist shows the components that need to be included in your <application> tag for SessionM integration.
View SessionM.xml
<receiver android:name="com.sessionm.api.ConnectionReceiver" >
<action android:name="" >
ndurell / AndroidManifest.xml
Last active Aug 29, 2015
This shows the permissions that are needed to add to your AndroidManifest.xml for integrating the SessionM SDK.
View AndroidManifest.xml
<manifest xmlns:android=""
android:versionName="1.9.0 Beta" >
android:targetSdkVersion="19" />
<!-- Begin SessionM -->
package ludia.sessionm;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.sessionm.api.ActivityListener;
import com.sessionm.api.BaseActivity;
import com.sessionm.api.SessionM;
import org.json.JSONException;
import org.json.JSONObject;