Skip to content

Instantly share code, notes, and snippets.

View eed3si9n's full-sized avatar

eugene yokota eed3si9n

View GitHub Profile
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.
#SingleInstance FORCE
#NoEnv
^`::
DetectHiddenWindows, off
IfWinExist, bash
{
wingetpos, wx, wy, wwidth, wheight
counter=0
@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._
@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
@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 { }
@orrsella
orrsella / sbt-global-plugin.md
Last active December 12, 2015 00:18
Instructions on how to reproduce sbt global plugin reload bug.
@halcat0x15a
halcat0x15a / TwitterMachine.scala
Last active December 15, 2015 00:28
Twitter User Streams with scala-machines!
import scala.language.postfixOps
import java.io._
import scalaj.http._
import scalaz._, Scalaz._
import scalaz.effect._, Effect._, IO._
import scalaz.concurrent.Promise
@paulp
paulp / transcript
Last active December 15, 2015 13:09
scala> class Bippy(xs: List[Int]) extends improving.TypesafeProxy(xs) { def isEmpty = true }
defined class Bippy
scala> val bippy = new Bippy(1 to 10 toList)
bippy: Bippy = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
scala> bippy.slice(3, 7)
[proxy] $line4.$read.$iw.$iw.bippy.slice(3, 7)
res1: List[Int] = List(4, 5, 6, 7)

collection

each(list, iterator, [context]forEachforeach
underscoreScala
https://github.com/sbt/sbt 1753
https://github.com/mpeltonen/sbt-idea 724
https://github.com/typesafehub/sbteclipse 361
https://github.com/sbt/sbt-assembly 266
https://github.com/sbt/sbt-native-packager 159
https://github.com/sbt/sbt-onejar 135
https://github.com/orfjackal/idea-sbt-plugin 126
https://github.com/sbt/sbt-release 123
https://github.com/sbt/sbt-start-script 111
https://github.com/xerial/sbt-pack 73