Skip to content

Instantly share code, notes, and snippets.

View yOpenSource's full-sized avatar
🎯
Focusing

yOpenSource

🎯
Focusing
View GitHub Profile
var Util = require('util');
var Https = require('https');
var Tls = require('tls');
/**
* HTTPS Agent for node.js HTTPS requests via a proxy.
* blog.vanamco.com/connecting-via-proxy-node-js/
*/
function HttpsProxyAgent(options)
{
@yOpenSource
yOpenSource / GitConfigHttpProxy.md
Created October 13, 2019 12:25 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@yOpenSource
yOpenSource / gist:477e0d8a227bf0e9e6a13b1f2ff091d5
Created October 9, 2019 19:17 — forked from iamdtang/gist:be8b4cc9558b3b6ab6cbef23150debe2
get bearer token from Twitter REST API for application-only authentication
require('dotenv').config();
const request = require('request');
const credentials = `${process.env.CONSUMER_KEY}:${process.env.CONSUMER_SECRET}`;
const credentialsBase64Encoded = new Buffer(credentials).toString('base64');
request({
url: 'https://api.twitter.com/oauth2/token',
method:'POST',
headers: {