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 play.api.Play._ | |
import play.api.Play.current | |
import com.codahale.jerkson._ | |
object JSON { | |
def stringify(o: Any): String = if (isDev) { new Json{}.generate(o) } else { Json.generate(o) } | |
def parse[T](json: String)(implicit m: Manifest[T]): T = try { | |
if (isDev) { new Json{}.parse[T](json) } else { Json.parse[T](json)} |
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
#!/bin/sh | |
PLAY_HOME=/var/play | |
pid=`cat $PLAY_HOME/RUNNING_PID 2> /dev/null` | |
if [ "$pid" == "" ]; then echo "play application is not running"; exit 1; fi | |
kill $pid | |
echo "shutdown play application." |
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 com.example; | |
import java.util.Locale; | |
import org.jvnet.localizer.LocaleProvider; | |
public class Resources { | |
public static void main(String[] args) throws Exception { | |
final WebRequestLocaleProvider localeProvider = new WebRequestLocaleProvider(); |
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
--- AbstractNonValidatingSAXTemplateParser.java 2012-03-02 15:43:16.000000000 +0900 | |
+++ AbstractNonValidatingSAXTemplateParser.java 2012-03-02 15:42:53.000000000 +0900 | |
@@ -123,6 +123,9 @@ | |
throw new TemplateInputException("Exception parsing document", e); | |
} catch (final TemplateProcessingException e) { | |
throw e; | |
+ } catch(final SAXParseException e) { | |
+ final String message = String.format("Exception parsing document: template=%s, near line=%d, column=%d", documentName, e.getLineNumber(), e.getColumnNumber()); | |
+ throw new TemplateInputException(message, e); | |
} catch (final SAXException 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
--- /Users/ussy/tmp/a.txt 2012-01-08 15:21:38.000000000 +0900 | |
+++ /Users/ussy/tmp/b.txt 2012-01-08 15:21:51.000000000 +0900 | |
@@ -1,3 +1,2 @@ | |
-<bean id="connectionProvider" class="jp.sf.amateras.mirage.dialect.HyperSQLDialect"> | |
- <property name="dialect" ref="dialect" /> | |
-</bean> | |
+<bean id="dialect" class="jp.sf.amateras.mirage.dialect.HyperSQLDialect" /> | |
+ |
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
(defun my-quick-specs() | |
(interactive) | |
(if buffer-file-name | |
(cond | |
((string-match "^\\(.*?/src/\\)test\\(/scala/.+?/\\)\\(.+?\\)Spec\\.scala$" buffer-file-name) | |
(let* ((base-dir (match-string 1 buffer-file-name)) | |
(target-dir (match-string 2 buffer-file-name)) | |
(target-name (match-string 3 buffer-file-name)) | |
(target-path (concat base-dir "main" target-dir target-name ".scala"))) | |
(find-file target-path))) |
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 PLUGIN_INFO = | |
<KeySnailPlugin> | |
<name>SBMCounter</name> | |
<name lang="ja">SBMCounter</name> | |
<description>Social Bookmark Counter</description> | |
<description lang="ja">ソーシャルブックマークカウンタ</description> | |
<version>0.1.0</version> | |
<!--<iconURL></iconURL>--> | |
<!--<updateURL></updateURL>--> | |
<author mail="[email protected]" homepage="http://www.pshared.net/">ussy</author> |
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
/* | |
* | |
* The DbUnit Database Testing Framework | |
* Copyright (C)2002-2004, DbUnit.org | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. | |
* |
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 com.example; | |
import java.lang.reflect.Method; | |
public class Client { | |
public static void main(String[] args) throws Exception { | |
A a = new A(); | |
B b = new B(); | |
Method m = A.class.getMethod("hello"); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="library" default="package"> | |
<property name="jarname" location="./bin/${ant.project.name}.jar" /> | |
<property name="src" location="./src" /> | |
<property name="bin" location="./bin" /> | |
<target name="clean"> | |
<delete dir="${bin}" /> | |
</target> |
NewerOlder