Skip to content

Instantly share code, notes, and snippets.

@cristianogregnanin
cristianogregnanin / Guard-livereload
Last active August 29, 2015 14:02
Guard config to monitoring php project. Run this commands in your root project path
#setup the Gemfile
$ nano Gemfile
source 'https://rubygems.org'
group :development do
gem 'guard'
gem 'guard-livereload', require: false
end
$ bundle
@cristianogregnanin
cristianogregnanin / config.ru
Last active August 26, 2015 16:22 — forked from chooh/config.ru
Simple Rack web server for static files with index.html
# This is the root of our app
@root = File.expand_path(File.join(File.dirname(__FILE__), "www"))
run Proc.new { |env|
# Extract the requested path from the request
req = Rack::Request.new(env)
index_file = File.join(@root, req.path_info, "index.html")
if File.exists?(index_file)
# Rewrite to index