Skip to content

Instantly share code, notes, and snippets.

View setting_up_a_new_remote_git_repository.textile

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@cemo
cemo / Slf4jSessionLogger.java
Created Jan 25, 2012 — forked from msosvi/Slf4jSessionLogger.java
This is a wrapper class for SLF4J. It is used when EclipseLink messages need to be logged through SLF4J.
View Slf4jSessionLogger.java
package org.eclipse.persistence.logging;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
/**
@cemo
cemo / ApplicationGuiceModule.java
Created May 6, 2012 — forked from kimble/ApplicationGuiceModule.java
Dropwizard instrumentation of Guice beans annotated with @timed
View ApplicationGuiceModule.java
package com.developerb.dropbot;
import com.developerb.dropbot.instrumentation.MethodInvocationTimingInterceptor;
import com.google.inject.AbstractModule;
import com.yammer.metrics.annotation.Timed;
import static com.google.inject.matcher.Matchers.annotatedWith;
import static com.google.inject.matcher.Matchers.any;
/**
@cemo
cemo / ketchup-bootstrap.js
Created May 9, 2012 — forked from plecong/ketchup-bootstrap.js
jQuery Ketchup with Twitter Bootstrap
View ketchup-bootstrap.js
!function( $ ) {
"use strict"
$.ketchup
.createErrorContainer(function(form, el) {
var g = el.closest('.controls');
if (g) {
@cemo
cemo / gist:3197136
Created Jul 29, 2012 — forked from ehoch/gist:3189712
writecapture2 mutex
View gist:3197136
var mutex = false;
function load_ads()
{
if (mutex) {
setTimeout("load_ads()", 100); // try again in 100 ms?
return;
}
mutex = true;
if (!$('#pushdown').html()) {
@cemo
cemo / DropwizardTestServer.java
Created Aug 15, 2012 — forked from kimble/DropwizardTestServer.java
JUnit @rule for running Dropwizard integration test. Ps! This is just a proof of concept. There are probably some landminds lying around waiting to go off, especially around lifecycle management and static state
View DropwizardTestServer.java
package com.developerb.dropwizard;
import com.yammer.dropwizard.AbstractService;
import com.yammer.dropwizard.Service;
import com.yammer.dropwizard.cli.Command;
import com.yammer.dropwizard.config.Configuration;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
View GrizzlyResourceTest.java
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import org.codehaus.jackson.map.Module;
import org.junit.After;
import org.junit.Before;
import com.google.common.collect.Lists;
View AddNumbersService.java
package com.example.helloworld.resources;
import javax.jws.WebMethod;
@javax.jws.WebService(
name = "AddNumbersPortType",
serviceName = "AddNumbersService",
targetNamespace = "http://duke.example.org")
@javax.jws.soap.SOAPBinding(
style = javax.jws.soap.SOAPBinding.Style.DOCUMENT,
@cemo
cemo / gist:3842008
Created Oct 5, 2012 — forked from christophercurrie/gist:3841860
Guice for Dropwizard
View gist:3842008
@Override
public ServletContainer getJerseyContainer(DropwizardResourceConfig resourceConfig,
MyServiceConfig serviceConfig) {
// I like having a root module, but you can use as many as you like
final Injector injector = Guice.createInjector(new MyServiceModule(serviceConfig));
return new GuiceContainer(injector) {
@Override
public ResourceConfig getDefaultResourceConfig(Map<String,Object> props, WebConfig webConfig) {
@cemo
cemo / rate_limit.js
Created Nov 21, 2012 — forked from mattheworiordan/rate_limit.js
Rate limiting function calls with JavaScript and Underscore.js
View rate_limit.js
/* Extend the Underscore object with the following methods */
// Rate limit ensures a function is never called more than every [rate]ms
// Unlike underscore's _.throttle function, function calls are queued so that
// requests are never lost and simply deferred until some other time
//
// Parameters
// * func - function to rate limit
// * rate - minimum time to wait between function calls
// * async - if async is true, we won't wait (rate) for the function to complete before queueing the next request