Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
class Test {
def hello() {
println "Hello"
}
}
@up1
up1 / gist:12247
Created September 23, 2008 08:42
public class Test {
}
<Searchplugin xmlns="http://www.mozilla.org/2006/browser/search/">
<shortname>Custom Search</shortname>
<description>Custom Search Description</description>
<inputencoding>UTF-8</inputencoding>
<Image width="16" height="16">data:image/gif;base64</Image>
<Url type="text/html" method="GET" template="my url">
<Param name="my parameter" value="{searchTerms}"/>
</Url>
<SearchForm>my url</SearchForm>
<p>Recent Posts:</p>
<div id="posts">
<%= partial("shared/post", :with => @posts) %>
</div>
สร้าง views/shared/_post.html.erb
<div id="post-<%= post.id %>" class="post">
<p class="body"><%= h(post.body) %></p>
<p class="created"><%= relative_date(post.create_date) %></p>
<h3>Post Message</h3>
<form action="/posts/create" method="post">
<textarea name="body" cols="50" rows="3"></textarea>
<input value="Post" type="submit">
</form>
@up1
up1 / gist:142599
Created July 8, 2009 05:09
เพิ่ม repository ที่เกี่ยวข้อง
<project>
....
....
....
<repositories>
<!-- Necessary if using snapshot builds of SpringSource products (as above) -->
<repository>
<id>SpringSource Enterprise Bundle Repository - External Bundle Snapshots</id>
<url>http://repository.springsource.com/maven/bundles/snapshot</url>
</repository>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
CMDDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.0.226)(PORT = 1521))
)
function readXml($domnode, &$array)
{
$array_ptr = &$array;
$domnode = $domnode->firstChild;
while (!is_null($domnode))
{
switch ($domnode->nodeType)
{
case XML_TEXT_NODE: if(!(trim($domnode->nodeValue) == ""))
$array_ptr['cdata'] = $domnode->nodeValue;
@up1
up1 / readxml
Created January 12, 2010 10:02
function readXml($domnode, &$array)
{
$array_ptr = &$array;
$domnode = $domnode->firstChild;
while (!is_null($domnode))
{
switch ($domnode->nodeType)
{
case XML_TEXT_NODE: if(!(trim($domnode->nodeValue) == ""))
$array_ptr['cdata'] = $domnode->nodeValue;