Skip to content

Instantly share code, notes, and snippets.

@ricn
ricn / gist:702427
Created November 16, 2010 20:16 — forked from headius/gist:702298
~/projects/jruby ➔ gem install -v1.5.5 org.jruby.jruby-complete
Installing from Maven using install at /Users/headius/apache-maven-3.0/bin
Successfully installed org.jruby.jruby-complete-1.5.5-java
1 gem installed
Installing ri documentation for org.jruby.jruby-complete-1.5.5-java...
Installing RDoc documentation for org.jruby.jruby-complete-1.5.5-java...
~/projects/jruby ➔ gem install -v1.5.3 org.jruby.jruby-complete
Installing from Maven using install at /Users/headius/apache-maven-3.0/bin
Successfully installed org.jruby.jruby-complete-1.5.3-java
resources :photos do
member do
get 'preview'
end
end
In 3.3:
http://localhost:8080/alfresco/service/api/server?alf_callback=func
returns
func({
"data":
{
"edition": "Enterprise",
"version": "3.3.3 (205)",
11:53:41,087 ERROR [web.context.ContextLoader] Context initialization failed
java.lang.NullPointerException
at org.springframework.extensions.config.xml.XMLConfigService.removeElementReaders(XMLConfigService.java:478)
at org.springframework.extensions.config.xml.XMLConfigService.destroy(XMLConfigService.java:149)
at org.springframework.extensions.config.BaseConfigService.reset(BaseConfigService.java:143)
at org.springframework.extensions.webscripts.AbstractRuntimeContainer.reset(AbstractRuntimeContainer.java:243)
at org.alfresco.repo.web.scripts.RepositoryContainer.init(RepositoryContainer.java:591)
at org.alfresco.repo.web.scripts.RepositoryContainer.reset(RepositoryContainer.java:565)
at org.alfresco.repo.web.scripts.RepositoryContainer$4.doWork(RepositoryContainer.java:519)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
require "rubygems"
require "mongoid"
Mongoid.configure do |config|
name = "mongoid_bug"
host = "localhost"
config.master = Mongo::Connection.new.db(name)
config.persist_in_safe_mode = false
end
controller code:
def toggle_star(conn, %{"id" => id}) do
bookmark = Repo.one(Bookmark.by_id_and_user_id(id, user_id(conn)))
if bookmark do
Bookmark.changeset(bookmark)
|> put_change(:starred, !bookmark.starred)
|> Repo.update!
render(conn, "toggle_star.json", starred: !bookmark.starred)
end
@ricn
ricn / Description
Created July 26, 2012 12:51
Authentication from scratch with Play 2 and Java
User authentication is required in almost every web application. This guide shows you step by step how to implement authentication from scratch with Play 2 and Java.
<project>
...
<profiles>
<profile>
<id>qa</id>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
# Migration
defmodule Bookmarks.Repo.Migrations.CreateBookmark do
use Ecto.Migration
def change do
create table(:bookmarks) do
add :href, :string, null: false, size: 2000
add :title, :string
add :description, :text
add :tags, {:array, :string}
=PROGRESS REPORT==== 9-Nov-2015::22:39:02 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.175.0>},
{id,alarm_handler},
{mfargs,{alarm_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]
=PROGRESS REPORT==== 9-Nov-2015::22:39:02 ===