Skip to content

Instantly share code, notes, and snippets.

View etsuo's full-sized avatar

J.P. Poveda etsuo

View GitHub Profile
@dogancelik
dogancelik / download.coffee
Last active November 5, 2020 01:37
How to download an image file? (Example) #Node.js
request = require 'request'
http = require 'http'
fs = require 'fs'
unirest = require 'unirest'
needle = require 'needle'
bhttp = require 'bhttp'
url = 'http://raw.githubusercontent.com/alrra/browser-logos/master/main-desktop.png'
# request
logout(): Promise<void> {
if (this.store.local.getItem(AUTH_STORAGE_KEY) || this.store.session.getItem(AUTH_STORAGE_KEY)) {
return this
.api
.post('Citizens/logout', {})
.catch(err => {
this.log.error(Error(`Unable to logout - response: ${res.status}`));
return Observable.of(null);
})
.do(() => {