Skip to content

Instantly share code, notes, and snippets.

@johnz
johnz / fetchUsers.js
Created February 3, 2019 21:33
Recursive fetch api until no next url
// Run in JsBin https://jsbin.com/gujemof/edit?js,console
let counter = 0;
const getUsersFromGraphApiFake = async (url) => {
counter++;
if (counter > 4) {
return {
users: [
@johnz
johnz / interceptor.js
Created July 27, 2015 05:05
angular http interceptor
(function() {
'use strict';
angular
.module('interceptor', [])
.config(config);
config.$inject = ['$httpProvider'];
function config($httpProvider) {
(function () {
'use strict';
angular.module('pollinator').service('service', myService);
myService.$inject = ['bbb', 'ccc'];
function myService(bbb, ccc){
// api
var service = {
@johnz
johnz / google_plus_profile.js
Created November 8, 2011 03:45
google plus profile in json format. no dob, zip, country, email, edu/work no start and end date
{
"kind":"plus#person",
"id":"112095195706125933013",
"displayName":"John Black",
"tagline":"Web developer",
"gender":"other",
"aboutMe":"<p>love internet and social game</p>",
"relationshipStatus":"engaged",
"url":"https://profiles.google.com/112095195706125933013",
"image":{