This file contains hidden or 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 com.sun.jersey.api.view.Viewable; | |
import org.apache.log4j.Logger; | |
import org.springframework.stereotype.Service; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
import java.util.Map; | |
@Path("/try") |
This file contains hidden or 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 MyModelOverrideLocal = Backbone.Model.extend({ | |
sync: function (method, model, options) { | |
if ( method === 'delete' ) { | |
if ( options.data ) { | |
// properly formats data for back-end to parse | |
options.data = JSON.stringify(options.data); | |
} | |
// transform all delete requests to application/json |
This file contains hidden or 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 com.thoughtworks.selenium.Selenium; | |
import org.jbehave.core.configuration.Configuration; | |
import org.jbehave.core.embedder.StoryControls; | |
import org.jbehave.core.failures.FailingUponPendingStep; | |
import org.jbehave.core.failures.PendingStepStrategy; | |
import org.jbehave.core.io.CodeLocations; | |
import org.jbehave.core.io.LoadFromClasspath; | |
import org.jbehave.core.io.StoryFinder; | |
import org.jbehave.core.junit.JUnitStories; | |
import org.jbehave.core.reporters.CrossReference; |
This file contains hidden or 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 org.jbehave.core.configuration.Configuration; | |
import org.jbehave.core.configuration.MostUsefulConfiguration; | |
import org.jbehave.core.configuration.spring.SpringStoryControls; | |
import org.jbehave.core.failures.FailingUponPendingStep; | |
import org.jbehave.core.failures.PendingStepStrategy; | |
import org.jbehave.core.io.CodeLocations; | |
import org.jbehave.core.io.LoadFromClasspath; | |
import org.jbehave.core.io.StoryFinder; | |
import org.jbehave.core.junit.JUnitStories; |
This file contains hidden or 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
// | |
// Have a module that takes no dependencies. | |
// | |
define({ | |
someProp: "Oooh, how interesting!", | |
someMethod: function() { | |
// do interesting work | |
return compellingValue; | |
} | |
}); |
This file contains hidden or 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 express = require('express'); | |
var cons = require('consolidate'); | |
var http = require('http'); | |
var reload = require('reload'); | |
var app = express(); | |
var server = http.createServer(app); | |
// Assign the handlebars engine to .html files | |
app.engine('html', cons.handlebars); |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" | |
version="3.0" | |
metadata-complete="true" | |
> | |
<display-name>Archetype Created Web Application</display-name> |
This file contains hidden or 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 com.fasterxml.jackson.core.JsonFactory; | |
import com.fasterxml.jackson.core.JsonParser; | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
@Path("/some_path") |
This file contains hidden or 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
// Within a jsp page | |
<script> | |
var options.saved_values=JSON.parse('${it.json_string_from_Java}'); | |
var theBackboneModel = new TheBackboneModel(options.saved_values,{parse:true}); | |
</script> |
This file contains hidden or 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
// Take note to change the source code for the correct path | |
// Example of using when there are multiple templates | |
var preloading = Backbone.Marionette.TemplateCache.preloadTemplates(['template1','template2'], this); | |
$.when(preloading).done(function() { | |
// Do something | |
}); |