Skip to content

Instantly share code, notes, and snippets.

View dariocravero's full-sized avatar

Darío Javier Cravero dariocravero

View GitHub Profile
@dariocravero
dariocravero / README.md
Created May 22, 2016 10:31 — forked from marten-de-vries/README.md
Running CouchApps on PouchDB in the browser using service workers - without any modifications!

Running CouchApps on PouchDB in the browser using service workers

What is this?

A description of how to run an existing CouchApp on PouchDB in the browser using service workers - without any modifications to existing code being necessary! The best thing is that if service workers aren't available, the CouchApp will still run as normal: that is, online.

Demo

Sequel.migration do
up do
run 'CREATE EXTENSION "uuid-ossp"'
create_table :products do
primary_key :id, {type: :uuid, default: Sequel.function(:uuid_generate_v4)}
end
end
end
require File.expand_path('../../../../app/helpers/issue_helper', __FILE__)
describe "IssueHelper" do
subject do
Class.new do
include Padrino::Helpers::OutputHelpers
include Padrino::Helpers::TagHelpers
include Magazineshop::IssueHelper
end
end
module MyApp
module CommonViewHelper
def self.registered(app)
app.helpers Helpers
end
alias :included :registered
module Helpers
def page_title(title="")
@base_title = "Test Titke"
@dariocravero
dariocravero / Gemfile
Created September 5, 2012 18:48
Minimal sinatra app with puma's config.
source "https://rubygems.org"
gem 'puma'
gem 'sinatra'