This is the haml version. If you want to use the same with erb just change haml
to erb
.
- Create you partial form example
_form.haml
(The underscore at the beginning is really important). - In you
.haml
file just write= partial("form")
.
require 'redis' | |
require 'json' | |
def get_redis_json() | |
FIELDS = ['title', 'desc', 'lat', 'lon'] | |
json = {} | |
FIELDS.each do |field| | |
json[field] = redis.get("point:#{id}:#{field}") |
This a simple sinatra scaffold using Thor
$ thor sinatra:scaffold <app-name>
<?php | |
require_once('includes/vendor/simplepie/simplepie.inc'); | |
$feed = new SimplePie(); | |
$feed->set_feed_url( 'your.xml' ); | |
//$feed->set_cache_location( $_SERVER['DOCUMENT_ROOT'] . '/includes/vendor/simplepie/cache' ); | |
//@TODO: I use my root because I'm using a simbolic link. I have to really understand whot virtualhost works. | |
$feed->set_cache_location( 'Set your location' ); | |
$feed->init(); | |
$feed->handle_content_type(); | |
?> |
import re | |
class HTTPForcedBasicAuthHandler(HTTPBasicAuthHandler): | |
auth_header = 'Authorization' | |
rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+' | |
'realm=(["\'])(.*?)\\2', re.I) | |
def __init__(self, *args, **kwargs): | |
HTTPBasicAuthHandler.__init__(self, *args, **kwargs) |
How to use Drupal Aliases
source 'http://rubygems.org' | |
gem 'sinatra' | |
gem 'dm' |