Skip to content

Instantly share code, notes, and snippets.

package main
import "fmt"
import "os"
var scores=map[string]string{
"qd__f_ee": "`b]__",
"qd_``baa": "_e]__",
"qd_`abah": "`d]__",
"qd_adcfb": "_e]d_",
@chanwit
chanwit / test.cpp
Created August 15, 2011 15:23
C++0x noob
#include <iostream>
#include <vector>
#include <string>
using namespace std;
//
// $ g++ --std=c++0x test.cpp
//
int main() {
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bat Tracer, a simple Twitter search client in Batman.js</title>
<script src="/batman/es5-shim.js" type="text/javascript"></script>
<script src="/batman/coffee-script.js" type="text/javascript"></script>
<script src="/batman/batman.js" type="text/javascript"></script>
<script src="/batman/batman.solo.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-1.1.0.min.css">
class DesktopScope implements Scope {
def get(String name, ObjectFactory of) {
def desktop = Executions?.current?.desktop
def obj = desktop?.getAttribute(name)
if(!obj) {
obj = of.getObject()
desktop?.setAttribute(name, obj)
}
return obj
<window apply="PersonComposer">
<grid>
<rows>
<row> <textbox id="txtFirstName"/> </row>
<row> <textbox id="txtLastName"/> </row>
<row> <textbox id="txtFullName"/> </row>
<row>
<hbox id="boxDialog">
<button>Save</button>
<button>Cancel</button>
<zk apply="zk.grails.Hangman">
<vbox>
<hbox>
Number of Wrong Guess: <label id="count" />
</hbox>
<image id="imgStep"/>
<hbox>
The Word:
<label id="answer"/>
</hbox>
@chanwit
chanwit / UserComposer.groovy
Created November 4, 2011 19:01
ZKGrails 2 - Ex. 1
class UserComposer extends GrailsComposer {
def afterCompose = { wnd ->
$('#buttonHolder').append {
button(label:"B1.1")
button(label:"B1.2")
button(label:"B1.3")
}
binds wnd
package helloworld
import org.zkoss.zk.grails.*
class HelloComposer extends GrailsComposer {
def afterCompose = { wnd ->
}
def world() {
package zk
import org.openqa.selenium.By
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeDriverService
import org.openqa.selenium.remote.RemoteWebDriver
import org.openqa.selenium.remote.DesiredCapabilities
import org.junit.runners.BlockJUnit4ClassRunner
a() => return new A();
class A extends Object {
Object _o;
A() : super() { }
Object get o() => return this._o;
set o(Object value) => this._o = value;
}
a()