Skip to content

Instantly share code, notes, and snippets.

View jvalteren's full-sized avatar

Jonathan van Alteren jvalteren

  • Groningen, Netherlands
  • 14:25 (UTC +01:00)
  • LinkedIn in/jvalteren
View GitHub Profile
@jvalteren
jvalteren / postman-oauth2-refresh-token.js
Created October 21, 2019 19:34 — forked from harryi3t/postman-oauth2-refresh-token.js
This gist shows how using the pre-request script in Postman, a new Oauth-2 token can be obtained using the a refresh token
/**
** Postman as of the date of this writing does not support auto-refreshing of Oauth-2 tokens.
** This is an exmaple on how in one can refresh their Oauth-2 tokens just using the pre-request scripts.
** Pre-requisites: You need to have a refresh token. You can use the Postman app to get one.
**/
// Set all these variables in an environment or at collection level
let tokenUrl = pm.variables.get('tokenUrl'),
clientId = pm.variables.get('clientId'),
clientSecret = pm.variables.get('clientSecret'),
@jvalteren
jvalteren / Iceberg related.st
Created July 25, 2019 07:43
Pharo workspace

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@jvalteren
jvalteren / gist:40ab1d6b5cde2ffb0201
Created March 25, 2015 16:18
Arduino convert MQTT byte* payload to float (max. 2 decimals) for use with small memory
float Tset = 0.0;
void mqttCallback(char* topic, byte* payload, unsigned int length) {
byte* payload; // input argument
// Check: http://playground.arduino.cc/Code/PrintFloats
// Also: http://www.varesano.net/blog/fabio/sending-float-variables-over-serial-without-loss-precision-arduino-and-processing
float f = 0.0;
int x = 0;
int index = -1;