Skip to content

Instantly share code, notes, and snippets.

View efroese's full-sized avatar

Erik Froese efroese

  • Twitter
  • New York
View GitHub Profile
# .bash_profile
#####################################################
# Terminal stuff
function parse_git_branch {
git rev-parse --git-dir &> /dev/null
git_status="$(git status 2> /dev/null)"
branch_pattern="^# On branch ([^${IFS}]*)"
@SuppressWarnings("unchecked")
public MongoClient(DB mongodb, Map<String,Object> props) {
this.mongodb = mongodb;
this.props = props;
String user = StorageClientUtils.getSetting(props.get(MongoClientPool.PROP_MONGO_USER), null);
String password = StorageClientUtils.getSetting(props.get(MongoClientPool.PROP_MONGO_USER), null);
if (user != null && password != null && !this.mongodb.isAuthenticated()){
if (!this.mongodb.authenticate(user, password.toCharArray())){
<!-- put this in startLevel 10
<bundle>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.7.2</version>
</bundle>
07.09.2011 09:50:16.456 *ERROR* [pool-1-thread-5] org.apache.sling.commons.scheduler.impl.QuartzScheduler Exception during job execution of org.sakaiproject.nakamura.user.counts.CountsRefreshJob@3c19a5b0 : null java.lang.StackOverflowError
at com.google.common.collect.ImmutableMap$RegularImmutableMap.<init>(ImmutableMap.java:555)
at com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:264)
at org.sakaiproject.nakamura.api.lite.authorizable.Authorizable.init(Authorizable.java:167)
at org.sakaiproject.nakamura.api.lite.authorizable.Authorizable.<init>(Authorizable.java:163)
at org.sakaiproject.nakamura.api.lite.authorizable.Group.<init>(Group.java:51)
at org.sakaiproject.nakamura.lite.authorizable.GroupInternal.<init>(GroupInternal.java:12)
at org.sakaiproject.nakamura.lite.authorizable.AuthorizableManagerImpl.findAuthorizable(AuthorizableManagerImpl.java:126)
at org.sakaiproject.nakamura.user.counts.GroupMembersCounter.countMembers(GroupMembersCounter.java:49)
at org.sakaiproject.nakamura.u
@efroese
efroese / gist:1120257
Created August 2, 2011 14:10
Determining group membership
// Checking the user side
currentUser.isAdmin()
@efroese
efroese / request.json
Created July 7, 2011 16:30
addIncludeExclude create ws call
{
"WsRestGroupSaveRequest":
{
"wsGroupToSaves":
[
{
"createParentStemsIfNotExist":"T",
"wsGroup":
{
@efroese
efroese / MailmanGroupManager.java
Created April 27, 2011 15:40
get email on sakai
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*