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
  • 17:24 (UTC -12:00)
View GitHub Profile
@tejasrsuthar
tejasrsuthar / List.md
Created September 20, 2016 11:20 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@tejasrsuthar
tejasrsuthar / FirebaseShareData
Created June 17, 2017 06:15
How to structure Firebase data and rules for sharing data between users
Since the user decides who'd they like to share the list with, I'd store that information in the user data itself. For example:
{
"rules": {
"$userPath": {
".write": "$userPath == 'acc_' + auth.id",
".read": "$userPath == 'acc_' + auth.id || root.child($userPath).child('shared').hasChild(auth.id)"
}
}
}
@tejasrsuthar
tejasrsuthar / Git push deployment in 7 easy steps.md
Created July 17, 2017 06:36 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
#!/bin/bash
# Anh Nguyen <anh.ng8@gmail.com>
# 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 / .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
@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 / 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 / composing-software.md
Created May 22, 2019 06:59 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@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 / 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