Skip to content

Instantly share code, notes, and snippets.

View eed3si9n's full-sized avatar

eugene yokota eed3si9n

View GitHub Profile
@eed3si9n
eed3si9n / xmlprotocol.scala
Created November 17, 2011 02:36
xml protocol generated by general test
// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
package general
/**
usage:
val obj = scalaxb.fromXML[general.Foo](node)
val document = scalaxb.toXML[general.Foo](obj, "foo", general.defaultScope)
**/
object `package` extends XMLProtocol { }
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@retronym
retronym / xml-namespace.scala
Created April 29, 2011 15:51
Scala XML Namespace wrangling
object XmlRewriteUtil {
def rewriter(f: PartialFunction[Node, NodeSeq]): RuleTransformer = new RuleTransformer(rule(f))
def rule(f: PartialFunction[Node, NodeSeq]): RewriteRule = new RewriteRule {
override def transform(n: Node) = if (f.isDefinedAt(n)) f(n) else n
}
}
def setNamespace(node: Node, prefix: String, namespace: String): Node = {
import XmlRewriteUtil._
#SingleInstance FORCE
#NoEnv
^`::
DetectHiddenWindows, off
IfWinExist, bash
{
wingetpos, wx, wy, wwidth, wheight
counter=0
1. Dump contents of http://www.w3.org/2003/05/soap-envelope/ to soap12.xsd
and put that somewhere alongside the other schemas.
2. Run scalaxb, you'll end up with a soap12.scala & company.
3. See sample code. Call envXml and get back XML representation of envelope,
header, and body all in one.