Skip to content

Instantly share code, notes, and snippets.

View Raaghu's full-sized avatar

Raghavendra Raaghu

View GitHub Profile
@Raaghu
Raaghu / config_env.js
Last active January 5, 2021 07:43
Vercel Private Git Dependecy in NPM
const fs = require("fs");
const home = process.env.HOME;
const zeitHome = "/vercel";
const configureGit = function (credentials) {
console.log("Configuring git credentials for zeit");
credentials.forEach(credential => {
fs.appendFileSync(
home + "/.git-credentials",
"https://" +
@Raaghu
Raaghu / environment-step.js
Created December 1, 2021 14:02
Run Jest Tests as sequence of steps
/* eslint-disable */
import NodeEnvironment from "jest-environment-node";
/**
* Enables to run as steps of a pipeline
*
* Features
* - run all previous tests before running the current test
* - Skip all future steps if current step fails
@Raaghu
Raaghu / node-ssl-proxy.js
Created April 19, 2023 06:19
Do you want to enable SSL for your server runnning in port 80 ?
const fs = require('fs');
const tls = require('tls');
const net = require('net');
const server = tls
.createServer(
{
key: fs.readFileSync('/opt/ssl/certs/key.pem'),
cert: fs.readFileSync('/opt/ssl/certs/cert.pem'),
},
clientToProxySocket => {