Skip to content

Instantly share code, notes, and snippets.

View Frenchcooc's full-sized avatar
☄️
We're hiring 🤘

Corentin Frenchcooc

☄️
We're hiring 🤘
View GitHub Profile
@Frenchcooc
Frenchcooc / regexp_capture.js
Last active May 21, 2018 16:28
Easy utilitary to get information from string using regexp
/**
* Simple RegExp capture
*/
function regexp_capture(regexp, data)
{
if (!data)
{ return false; }
var output = (new RegExp(regexp)).exec(data);
@Frenchcooc
Frenchcooc / request-native.js
Created May 21, 2018 08:44
Make native http/https requests for node js
/*
* Make native http/https requests
*
* @usage: NativeRequest([URL|options])
* @demo: NativeRequest('https://example.org')
*
* @output: <http.ClientRequest> - see https://nodejs.org/api/http.html#http_http_request_options_callback
*/
const { URL } = require('url')