Skip to content

Instantly share code, notes, and snippets.

@zhenja
zhenja / postman-pre-request-script.js
Created October 28, 2018 13:16
Postman Pre-request Script to automatically get a Bearer Token from OAuth and save it for reuse
const moment = require('moment');
const getAuthorization = {
url: pm.environment.get("tokenBaseURL") + '/ia2oauth/token',
method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: {
@zhenja
zhenja / CrashlyticsSwift.swift
Last active October 28, 2018 13:05
Crashlytics CLS_LOG() in Swift
//
// Created by Dima Vartanian on 10/29/15.
// https://gist.github.com/DimaVartanian/a8aa73ba814a61f749c0
// Updated by me
import Foundation
import Crashlytics
/// This method gives us pretty much the same functionality as the CLS_LOG macro, but written as a Swift function, the only differences are that we have to use array syntax for the argument list and that we don't get see if the method being called is a class method or an instance method. We also have to define the DEBUG compiler flag with -D DEBUG.
///

Keybase proof

I hereby claim:

  • I am zhenja on github.
  • I am zhenja (https://keybase.io/zhenja) on keybase.
  • I have a public key ASDmOIvAWB4DXrg1NJtz5xgD8DmGv8cxyQOw7fkwqC2rvgo

To claim this, I am signing this object: