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
| <filter> | |
| <filter-name>encodingFilter</filter-name> | |
| <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> | |
| <init-param> | |
| <param-name>encoding</param-name> | |
| <param-value>UTF-8</param-value> | |
| </init-param> | |
| <init-param> | |
| <param-name>forceEncoding</param-name> | |
| <param-value>true</param-value> |
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
| apply plugin: 'jetty' | |
| apply plugin: 'java' | |
| apply plugin: 'groovy' | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| providedRuntime 'org.mortbay.jetty:jetty-ajp:6.1.26' |
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
| -client | |
| -startup | |
| ../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar | |
| --launcher.library | |
| ../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.100.v20110502 | |
| -product | |
| org.eclipse.epp.package.java.product | |
| --launcher.defaultAction | |
| openFile | |
| -showsplash |
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 groovy.xml.MarkupBuilder | |
| def sb = new StringWriter() | |
| def html = new MarkupBuilder(sb) | |
| html.doubleQuotes = true | |
| html.expandEmptyElements = true | |
| html.omitEmptyAttributes = false | |
| html.omitNullAttributes = false | |
| html.html { |
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
| db.foo.remove(); | |
| var rnd = function() { | |
| return Math.floor(Math.random() * 1000 + 100).toString(); | |
| } | |
| var date1 = new Date(); | |
| for (var i=0; i<1000000; i++) { | |
| var row1 = {key: rnd(), value: 'data'+rnd()} | |
| db.foo.save(row1); | |
| } | |
| print(new Date().getTime()-date1.getTime()); |
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
| @GrabConfig(systemClassLoader=true) | |
| @GrabResolver(name='monkproject', root='http://www.monkproject.org/maven2/') | |
| @Grab(group='org.tmatesoft.svnkit', module='svnkit', version='1.3.5') | |
| @Grab(group='org.tmatesoft.svnkit', module='svnkit-javahl', version='1.3.5') | |
| @Grab(group='org.monkproject', module='svnant', version='1.1.0-rc2') | |
| @Grab(group='org.monkproject', module='svnClientAdapter', version='1.1.0-rc2') | |
| def ant = new AntBuilder() | |
| ant.typedef(resource: 'org/tigris/subversion/svnant/svnantlib.xml') | |
| ant.svn(username: 'guest', password: 'password') { |
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 zlib = require('zlib'); | |
| var compress = function(req, res, result) { | |
| var acceptEncoding = req.headers['accept-encoding']; | |
| if (!acceptEncoding) { acceptEncoding = ''; } | |
| if (acceptEncoding.match(/\bdeflate\b/)) { | |
| zlib.deflate(result, function(err, result) { | |
| if (!err) { | |
| res.writeHead(200, { 'content-encoding': 'deflate' }); | |
| res.send(result); |
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
| /** | |
| * InputTextMask script used for mask/regexp operations. | |
| * Mask Individual Character Usage: | |
| * 9 - designates only numeric values | |
| * L - designates only uppercase letter values | |
| * l - designates only lowercase letter values | |
| * A - designates only alphanumeric values | |
| * X - denotes that a custom client script regular expression is specified</li> | |
| * All other characters are assumed to be "special" characters used to mask the input component. | |
| * Example 1: |
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 mongo = require('mongoskin') | |
| , db = mongo.db('localhost/collection') | |
| , mongoStore = require('connect-mongodb'); | |
| //... | |
| db.open(function(err, db) { | |
| app.configure(function() { | |
| //... | |
| app.use(express.cookieParser()); |
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
| // refer http://www.bishen.org/content/35579925757 | |
| var express = require('express') | |
| , ejs = require('ejs') | |
| , routes= require('./routes') | |
| , cache = require('connect-cache'); | |
| var app = module.exports = express.createServer( | |
| cache({rules: [ | |
| {regex: /.*/, ttl: 21600000}, |