Skip to content

Instantly share code, notes, and snippets.

View tejasrsuthar's full-sized avatar
🏠
Working from home

Tejas Suthar tejasrsuthar

🏠
Working from home
  • Mobiquity Inc.
  • Ahmedabad
  • 19:27 (UTC -12:00)
View GitHub Profile
@tejasrsuthar
tejasrsuthar / nginxproxy.md
Created June 12, 2020 02:13 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@tejasrsuthar
tejasrsuthar / logging.js
Created April 7, 2020 04:57
A simple node module that makes console.log/error/warn/debug statements log through winston (simply include at the beginning of your app)
'use strict';
var util = require('util'),
winston = require('winston'),
logger = new winston.Logger(),
production = (process.env.NODE_ENV || '').toLowerCase() === 'production';
module.exports = {
middleware: function(req, res, next){
console.info(req.method, req.url, res.statusCode);
@tejasrsuthar
tejasrsuthar / composing-software.md
Created May 22, 2019 06:59 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@tejasrsuthar
tejasrsuthar / ImportantModules.md
Last active May 20, 2019 11:44
Most important Node.js modules for day to day development
@tejasrsuthar
tejasrsuthar / remove-node_modules
Created April 9, 2018 06:42 — forked from cassidoo/remove-node_modules
Remove node_modules from git
Add to .gitignore file
node_modules
Then call:
git rm -r --cached node_modules
git commit -m "Remove node_modules now that they're ignored!"
git push origin master
@tejasrsuthar
tejasrsuthar / stateToAbbr.js
Created January 10, 2018 11:55 — forked from calebgrove/stateToAbbr.js
Convert state name to abbreviation in JavaScript
// USAGE:
// abbrState('ny', 'name');
// --> 'New York'
// abbrState('New York', 'abbr');
// --> 'NY'
function abbrState(input, to){
var states = [
['Arizona', 'AZ'],
@tejasrsuthar
tejasrsuthar / .gitlab-ci.yml
Last active September 28, 2020 20:17
Gitlab to Staging Server basic configuration
image: node:latest
stages:
- build
- deploy
before_script:
- npm install mocha
install_dependencies:
@tejasrsuthar
tejasrsuthar / .gitignore
Created August 16, 2017 00:04 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
#!/bin/bash
# Anh Nguyen <[email protected]>
# 2016-04-30
# MIT License
# This script takes in images from a folder and make a crossfade video from the images using ffmpeg.
# Make sure you have ffmpeg installed before running.
# The output command looks something like the below, but for as many images as you have in the folder.
@tejasrsuthar
tejasrsuthar / .gitlab-ci.yml
Last active October 8, 2017 22:09
Sample Pipeline configuration for Gitlab
image: node:6.10.3
stages:
- init
- tests
- deploy
- production
init:
stage: init