WAT?
Lyon.rb - Octobre 2012
Philippe Creux - @pcreux
- http://pcreux.com
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb | |
# and made a lot more robust by me | |
# this implementation uses erb by default. if you want to use any other template mechanism | |
# then replace `erb` on line 13 and line 17 with `haml` or whatever | |
module Sinatra::Partials | |
def partial(template, *args) | |
template_array = template.to_s.split('/') | |
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}" | |
options = args.last.is_a?(Hash) ? args.pop : {} | |
options.merge!(:layout => false) |
# If you're having cert issues on ruby 2.0.0-p0, the issue is most likely that ruby can't | |
# find the required intermediate certificates. If you built it via rbenv/ruby-build, then | |
# the certs are already on your system, just not where ruby expects them to be. | |
# When ruby-build installs openssl, it installs the CA certs here: | |
~/.rbenv/versions/2.0.0-p0/openssl/ssl/cacert.pem | |
# Ruby is expecting them here: | |
$(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE') | |
# Which for me, is this path: |
WAT?
Lyon.rb - Octobre 2012
Philippe Creux - @pcreux
- http://pcreux.com
<html> | |
<head></head> | |
<body> | |
<canvas id="canvas" width="800" height="600"></canvas> | |
<script> | |
var canvas = document.getElementById("canvas").getContext('2d'); | |
canvas.shadowColor="#000"; |
marko@harman:~$ sudo gem install rails | |
[sudo] password for marko: | |
Successfully installed activesupport-3.0.0 | |
Successfully installed i18n-0.4.1 | |
Successfully installed activemodel-3.0.0 | |
Successfully installed rack-1.2.1 | |
Successfully installed rack-mount-0.6.13 | |
Successfully installed tzinfo-0.3.23 | |
Successfully installed erubis-2.6.6 | |
Successfully installed actionpack-3.0.0 |