Skip to content

Instantly share code, notes, and snippets.

@azeemh
azeemh / nginxproxy.md
Created June 29, 2017 15:26 — 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

@azeemh
azeemh / nginx.md
Last active June 29, 2017 19:13
Simple Deployment of App to Proxy with Nginx & Ubuntu 16.04 (Rails, Sinatra, PHP, etc)

This tutorial can be used for any application that runs a server on localhost:port, in this case localhost:3000. i.e. rails s, any sinatra or nodejs server bound to a port, and even php -S localhost:3000...

INSTALL NGINX

purges any old versions

sudo apt-get purge nginx*

install clean nginx

<div id="container"></div>
<h2 style="text-align: center; color: #e50435; background-color: rgba(0,0,0,.2); padding:10px;">Find Us</h2>
<iframe id="map" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3022.3144179024976!2d-73.9885187848746!3d40.75510884291463!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c259ab2d9a9f23%3A0xd81666ef603e9144!2s1460+Broadway%2C+New+York%2C+NY+10036!5e0!3m2!1sen!2sus!4v1529363043589" width="100%" height="600" frameborder="0" allowfullscreen></iframe>
<!-- add http://react-responsive-carousel.js.org with engines for cars and aircraft -->
@azeemh
azeemh / barter.sh
Last active September 12, 2018 01:42
Barter Generator Script (rails 5.2+)
#!/bin/bash
cd
rails new barter --database=postgresql
cd barter
rails db:drop
rails db:create
rails db:migrate
###setup home controller
@azeemh
azeemh / index.html
Created April 5, 2021 00:35
The Matrix - Digital Rain
<canvas id="digitalRain"></canvas>
@azeemh
azeemh / animated-continuous-sections-with-gsap-observer.markdown
Created August 31, 2022 05:09
Animated Continuous Sections with GSAP Observer
@azeemh
azeemh / gorailsbashm2mac.md
Last active October 3, 2022 17:02
Installing ruby with rbenv on a Mac m2 using a bash terminal (because go rails only has zsh instructions)

Installing ruby with rbenv on a Mac m2 using a bash terminal (because go rails only has zsh instructions)

Change terminal to bash first

chsh -s /bin/bash

Install home-brew using the command from their website (https://brew.sh)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

@azeemh
azeemh / .bashrc
Created December 29, 2023 21:12
Bash Function to convert webm to mp4
# Based on the command used in https://askubuntu.com/a/1462885
#
# ffmpeg -i screencast.webm -filter:v "scale=trunc(iw/2)*2:trunc(ih/2)*2,fps=30" screencast.mp4
#
# Easily call this lengthy command with webm2mp4 filename.webm
#
# Add this to your ~/.bashrc file to easily access
#function to convert webm to mp4 via ffmpeg
function webm2mp4() {
@azeemh
azeemh / summernote-lite.js
Created May 15, 2024 22:27
Summernote Lite 8.1.8.2 -- A Video update Patch retaining 8.1.8 functionality with 8.1.9 video and regex recognition for new Youtu.be and Google Drive view links etc, (8.1.9 breaks code edit which works in 8.1.8)
/*!
*
* Super simple wysiwyg editor v0.8.18.2 -- Azeem's video edit patch
* https://summernote.org
*
*
* Copyright 2013- Alan Hong. and other contributors
* summernote may be freely distributed under the MIT license.
*
* Date: 2020-05-20T18:09Z