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
(function (window, document, $, undefined) { | |
if (!$.Deferred) throw 'jQuery 1.5 is required to use the jQuery.oauth script!'; | |
function require(name, url) { | |
if (window[name] === undefined) | |
return $.ajax({ type: 'GET', cache: true, dataType: 'script', url: url }); | |
} | |
$.oauth = function (options) { | |
var d = $.Deferred(); |
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
/* | |
Chrome does not let you modify the keyCode prop when you trigger it, so it defaults to 0. | |
You can use this code to trigger a keydown with a char code of 0 in chrome. | |
If you use initKeyEvent instead of initKeyboardEvent, it will work in FF | |
(the bellow example would trigger keydown with a char code of 65 in FF). | |
*/ | |
document.addEventListener( 'keydown', function( event ){ | |
console.log( event.keyCode ) |
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
""" | |
jQuery templates use constructs like: | |
{{if condition}} print something{{/if}} | |
This, of course, completely screws up Django templates, | |
because Django thinks {{ and }} mean something. | |
Wrap {% verbatim %} and {% endverbatim %} around those | |
blocks of jQuery templates and this will try its best |
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
package testsupport; | |
import org.concordion.api.ResultSummary; | |
import org.concordion.internal.FixtureRunner; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.FrameworkMethod; | |
import org.junit.runners.model.InitializationError; | |
import org.junit.runners.model.Statement; | |
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
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
@RequestMapping(value = "/download/{filename:.+}", method = RequestMethod.GET) | |
public void download(@PathVariable("filename") String filename,HttpServletRequest request ,HttpServletResponse response){ | |
try { | |
File file=new File(request.getSession().getServletContext().getRealPath("/download/"+filename)); | |
response.setCharacterEncoding("utf-8"); | |
response.setContentType("multipart/form-data"); | |
response.setHeader("Content-Disposition", "attachment;filename="+ filename); | |
response.setHeader("Content-Length", "" + file.length()); | |
//System.out.println(file.getAbsolutePath()); | |
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
/** | |
* Find the longest class names in Spring. | |
* Also find FactoryFactory classes. | |
* a goof-off project by @thom_nic | |
*/ | |
import java.util.jar.* | |
defaultTasks 'longest', 'factoryfactory' |