#!/bin/bash | |
cd | |
rails new barter --database=postgresql | |
cd barter | |
rails db:drop | |
rails db:create | |
rails db:migrate | |
###setup home controller |
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
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
/*! | |
* jquery oembed plugin | |
* | |
* Copyright (c) 2009 Richard Chamorro | |
* Licensed under the MIT license | |
* | |
* Orignal Author: Richard Chamorro | |
* Forked by Andrew Mee to Provide a slightly diffent kind of embedding experience | |
*/ | |
(function ($) { |
#Acts As Votable (aka Acts As Likeable)
Acts As Votable is a Ruby Gem specifically written for Rails/ActiveRecord models. The main goals of this gem are:
- Allow any model to be voted on, like/dislike, upvote/downvote, etc.
- Allow any model to be voted under arbitrary scopes.
- Allow any model to vote. In other words, votes do not have to come from a user, they can come from any model (such as a Group or Team).
- Provide an easy to write/read syntax.
##Steps
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
function parseVideo (url) { | |
// - Supported YouTube URL formats: | |
// - http://www.youtube.com/watch?v=My2FRPA3Gf8 | |
// - http://youtu.be/My2FRPA3Gf8 | |
// - https://youtube.googleapis.com/v/My2FRPA3Gf8 | |
// - Supported Vimeo URL formats: | |
// - http://vimeo.com/25451551 | |
// - http://player.vimeo.com/video/25451551 | |
// - Also supports relative URLs: | |
// - //player.vimeo.com/video/25451551 |