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
#!/usr/bin/env python | |
import random | |
from bottle import route, run, request, install | |
from bottle_redis import RedisPlugin | |
install(RedisPlugin()) | |
@route('/ask') |
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
# Modify Bottle application as follows: | |
# import sys | |
# ... | |
# run(port=sys.argv[1], debug=True) | |
# | |
# Then run | |
# python app.py 8081 | |
# python app.py 8082 | |
# nginx -p . -c nginx.conf | |
# |
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
@echo off | |
REM Enable by running the following command: | |
REM reg add "HKCU\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d ^%USERPROFILE^%\.profile.cmd /f | |
set HOME=%USERPROFILE% | |
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_01 | |
set PATH=%JAVA_HOME%\bin;%PATH% | |
set ANT_HOME=C:\apache-ant-1.9.2 |
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
Question from fishygut: | |
What are the main differences between Java EE 7 and Java EE 6 ? | |
4 Answers | |
puffstone: Support for JSON | |
barkingcustard: GlassFish v4 | |
puffstone: Improved Bean Validation | |
barkingcustard: WebSocket support |
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
<artifact:dependencies pathId="dependency.classpath"> | |
<remoteRepository id="objectdb" url="http://m2.objectdb.com" /> | |
<dependency groupId="com.objectdb" artifactId="objectdb" version="2.5.3_02" /> | |
</artifact:dependencies> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Test</title> | |
</head> | |
<body> | |
... | |
<script src="test.js"></script> | |
</body> |
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
/* | |
Per <http://stackoverflow.com/questions/5691901/using-the-underscore-module-with-node-js>, | |
from the Node.js REPL, use two underscores (__) instead of a single underscore (_) | |
because Node uses _ for the last return value. | |
Note that if your program is in a file, you can still use a single underscore (_). | |
*/ | |
var __ = require("underscore"); | |
__.each([1, 2, 3], function(e) { console.log(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
(function(global) { | |
if (typeof java !== "undefined") { | |
this.console = { log: function(s) { println(s); } } | |
// Download from https://raw.github.com/micmath/Rhino-Require/master/src/require.js | |
load("require.js"); | |
} | |
}(this)); | |
// Call console.log() and require() as usual |
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
<% if (typeof message !== "undefined") { %> | |
<%= message %> | |
<% } %> | |
<form method="POST"> | |
State: | |
<input type=text name="state" | |
value="<%= state %>" size=2 maxlength=2> | |
<input type="submit"> | |
</form> |
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
<% if (typeof message !== "undefined") { %> | |
<%= message %> | |
<% } %> | |
<form method="POST"> | |
State: | |
<input type=text name="state" | |
<% if (typeof state !== "undefined") { %> | |
value="<%= state %>" | |
<% } %> | |
size="2" maxlength="2"> |