$ cat /etc/apache2/sites-enabled/mms-test
Listen 50690
LogLevel debug
DumpIOInput On
# DumpIOOutput On
$ sudo tail -f /var/log/apache2/error.log | grep "mod_dumpio.c(74)" | sed "s/.*HEAP.: //"
/ A simplistic way of loading and rendering HAML partials (header.haml, footer.haml, nav.haml... you name it) without Rails | |
/ Useful when using tools like LiveReload http://livereload.com/ | |
/ but don't want to configure a web server just to use PHP include/require constructs (discussion http://help.livereload.com/discussions/questions/22-haml-partials) | |
/ It could be improved/simplified using a helper http://stackoverflow.com/questions/5436769/partial-haml-templating-in-ruby-without-rails/5436973#5436973 | |
/ Check out the Jade version https://gist.github.com/2593727 | |
%html | |
%body | |
%header | |
= Haml::Engine.new(File.read('/path/to/your/partial.haml')).render |
class DriveAPI | |
include HTTParty | |
base_uri 'https://www.googleapis.com' | |
#for debugging | |
debug_output $stdout | |
end | |
def create_file(file_name, parent_id) | |
check_token! | |
access_token = current_user.access_token |
class MyResource | |
include HTTParty | |
debug_output $stdout # <= will spit out all request details to the console | |
#... | |
end |
sudo rails server -b 0.0.0.0 -p 80 |
def before_render(&block) | |
(@_before_render ||= []) << block | |
end | |
def render() | |
@_before_render.each(&:call) | |
end |
#http://stackoverflow.com/questions/4150782/using-yaml-with-variables | |
key : 'This is the foobar var : %{foobar}' | |
content = file['key'] | |
modified_content = content % { :foobar => foobar } |
activate :blog do |blog| | |
blog.prefix = 'blog' | |
blog.defaultextension = '.markdown' | |
blog.sources = 'articles/{category}/{title}' | |
blog.permalink ='{category}/{title}' | |
blog.summary_separator = /(READMORE)/ | |
blog.layout = '/blog/bloglayout' | |
blog.tagtemplate = 'tag.html' | |
blog.calendartemplate = 'calendar.html' | |
# Enable pagination |