Skip to content

Instantly share code, notes, and snippets.

View pbaio's full-sized avatar

Peter pbaio

  • Enterprise Engineer @ Meta
  • New Jersey, United States
View GitHub Profile
@pbaio
pbaio / Template IISNode Web.config
Last active November 15, 2024 14:52
IISNode Web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!--
All appSettings are made available to your Node.js app via environment variables
You can access them in your app through the process.env object.
process.env.<key>
-->
@pbaio
pbaio / logger.js
Last active March 26, 2019 03:23
Winston Transports setup for Daily Rotation and separate files per log level
'use strict';
var winston = require('winston');
var DailyRotateFile = require('winston-daily-rotate-file');
winston.emitErrs = true;
var logger = new winston.Logger( {
transports: [
new winston.transports.Console({
level: 'debug',
@pbaio
pbaio / gulpfile.js
Last active April 18, 2017 18:51
gulpfile with Browserify, BrowserSync, Nodemon and JSHint, entires values will need to be changed for each application that uses this
'use strict';
const browserify = require('browserify');
const browserSync = require('browser-sync');
const gulp = require('gulp');
const gutil = require('gulp-util');
const nodemon = require('gulp-nodemon');
const uglify = require('gulp-uglify');
const watchify = require('watchify');
const jshint = require('gulp-jshint');
@pbaio
pbaio / angular-socketProvider.js
Last active July 8, 2016 16:41
Working & complete version of socket.io provider
(function () {
'use strict';
var angular = require('angular');
var io = require('socket.io-client');
angular
.module('socket.io', [])
.provider('$socket', $socketProvider);
@pbaio
pbaio / downloadS3Object.js
Last active March 7, 2017 20:41
Downloads a File from a Bucket, saves it to a location on disk and returns a Promise
'use strict';
const fs = require('fs');
const AWS = require('aws-sdk');
const S3 = new AWS.S3(); // pass in config if you need to, use default credentials location
module.exports = (bucket, key, dest) => {
return new Promise((resolve, reject) => {
let ws = fs.createWriteStream(dest);