Skip to content

Instantly share code, notes, and snippets.

>rake db:bootstrap
(in /home/maiz/projetos/my_store)
[find_by_param error] database not available?
This task will destroy any data in the database. Are you sure you want to
continue? [yn] y
== SpreeZeroNineZero: migrating ==============================================
-- create_table("addresses", {:force=>true})
NOTICE: CREATE TABLE will create implicit sequence "addresses_id_seq" for serial column "addresses.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "addresses_pkey" for table "addresses"
-> 0.1865s
> script/server
>script/extension install git://github.com/softa/mailee_spree
removing: /home/maiz/projetos/my_store/vendor/extensions/mailee_spree/.git
Initialized empty Git repository in /home/maiz/projetos/my_store/vendor/extensions/mailee_spree/.git/
remote: Counting objects: 19, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 19 (delta 1), reused 0 (delta 0)
Receiving objects: 100% (19/19), 18.56 KiB, done.
Resolving deltas: 100% (1/1), done.
Mailee::Config.site = 'http://api.0x1xc4x5ebxax.spreedemo.mailee.me'
> rake -D mailee:send
(in /home/maiz/projetos/my_store)
rake mailee:send
Sincroniza os items da tabela "users" com os contatos do Mailee.
Você pode também especificar o env AFTER para enviar apenas os contatos atualizados após uma data.
E.g. rake mailee:send CLASS=Contact AFTER=1.day
> rake mailee:send
(in /home/maiz/projetos/my_store)
Enviando
.............. (segue)
Processing UsersController#create (for 127.0.0.1 at 2010-05-14 16:59:59) [POST]
Parameters: {"commit"=>"Create", "action"=>"create", "authenticity_token"=>"XFJroHBsMoFLCJRqYC3Z15c7U3hooDDiqZW09pWAH6U=", "controller"=>"users", "user"=>{"password_confirmation"=>"[FILTERED]", "openid_identifier"=>"", "password"=>"[FILTERED]", "email"=>"[email protected]"}}
AppConfiguration Load (1.0ms) SELECT * FROM "configurations" WHERE ("configurations"."name" = E'Default configuration') AND ( ("configurations"."type" = 'AppConfiguration' ) ) LIMIT 1
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
SQL (0.3ms) BEGIN
User Load (1.5ms) SELECT "users".id FROM "users" WHERE (LOWER("users"."email") = E'[email protected]') LIMIT 1
User Load (1.0ms) SELECT "users".id FROM "users" WHERE (LOWER("users"."login") = E'[email protected]') LIMIT 1
User Load (0.3ms) SELECT "users".id FROM "users" WHERE ("users"."persistence_token" = E'8b2211023b79864659e7ac4ebb1f51362a4d35e7ca1bcb7
##
# Identity Monad for Ruby taken from
# http://moonbase.rydia.net/mental/writings/programming/monads-in-ruby/00introduction.html
# ... but without the typos and with complete functions
##
class Identity
attr_reader :value
def initialize( value )
@value = value
---
format: markdown+lhs
title: A simple pasteboard app
...
We're going to write a simple "pasteboard" web application in Haskell,
using `happstack-server` and `HDBC`. Here's the basic interface:
`GET /`
: show a form for entering some code, a title, and a syntax
-- relational.hs
import Database.HDBC
import Database.HDBC.PostgreSQL
import Data.List
printTuples conn rel = quickQuery' conn ("SELECT DISTINCT * FROM " ++ rel) []
(⋈) = intercalate " NATURAL JOIN "
(π) fields rel1 = "(SELECT " ++ (intercalate "," fields) ++ " FROM " ++ rel1 ++ ") a"