This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static com.netflix.beacon.server.ServletModuleAssert.assertBindingToPattern; | |
import org.junit.Test; | |
import com.google.inject.Injector; | |
public class GuiceServletConfigTest { | |
@Test | |
public void testBinding() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.mockito.Mockito.mock; | |
import static org.mockito.Mockito.when; | |
import com.google.inject.Binding; | |
import com.google.inject.Injector; | |
import com.google.inject.servlet.GuiceFilter; | |
... | |
public static void assertInit(Injector injector) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code licensed under the Apache License v2.0 http://www.apache.org/licenses/LICENSE-2.0 | |
public class AnyThrow { | |
public static RuntimeException uncheked(Throwable e) { | |
AnyThrow.<RuntimeException>throwAny(e); | |
return null; | |
} | |
@SuppressWarnings("unchecked") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
doSomethingThatThrows.exception(); | |
} catch (Exception e) { | |
throw uncheked(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load: | |
- public/javascripts/external/jquery-1.7.1.min.js | |
- http://localhost:9000/assets/javascripts/my_file1.js | |
- http://localhost:9000/assets/javascripts/my_file2.js | |
- test/javascripts/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getResources: function (path, callback) { | |
$.ajax({ | |
'dataType': 'jsonp text', | |
'crossDomain': true, | |
'url': path, | |
'success': function (data) { | |
utils.async(function () { | |
callback(data) | |
}); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ember.View.create({ | |
templateName: templateId | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//current is a reference to the Application object | |
import play.api.Play.current | |
object Templates extends Controller { | |
//name is the template name | |
//callback is the jQuery jsonp function name as in jQuery17104730278281494975_1332396095851 | |
def load(name: String, callback: String) = Action { request => | |
val path = current.getFile("/templates/%s.handlebars.html".format(name)); | |
val content = Files.readFile(path) | |
//making the file content javascript ready |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /template/:name my.package.Templates.load(name: String, callback: String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myView = Ember.View.extend({ templateName: 'my_view' }), | |
myWidget = Ember.View.extend({ templateName: 'widget/another_view' }); |
OlderNewer