Skip to content

Instantly share code, notes, and snippets.

View yoavniran's full-sized avatar
📖
Writing. Code & Prose

Yoav Niran yoavniran

📖
Writing. Code & Prose
View GitHub Profile
@yoavniran
yoavniran / node-remove-dir.js
Last active May 13, 2020 15:58
Node async & recursive dir remove
"use strict";
var path = require("path"),
fs = require("fs");
module.exports = (function(){
/**
* recursively remove the fs structure starting from (and including) the path given in dirToRemove
* @param dirToRemove
* the path to remove
@yoavniran
yoavniran / SimpleAuthTransporter.js
Last active May 6, 2024 12:33
class used to allow making authorized requests to google API that also allows streaming the response even if a token refresh is required
"use strict";
var util = require("util"),
_ = require("underscore"),
events = require("events"),
request = require("request"),
AppAuthClient = require("../google/AppAuthClient"); //thin wrapper around the google oauth2client - simply initializing it with app's client id and secret
var SimpleAuthTransporter= (function () {