Skip to content

Instantly share code, notes, and snippets.

View ebruchez's full-sized avatar

Erik Bruchez ebruchez

View GitHub Profile
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
<xh:html
xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms">
<xh:head>
<xh:style>
.outer-group { display: block; border: 1px solid blue }
.outer-iteration { border: 1px solid red; margin-bottom: 1em }
.inner-iteration { border: 1px solid green }
</xh:style>
<xf:model>
@ebruchez
ebruchez / test.coffee
Last active September 15, 2015 16:46
_findControl: (controlIdOrElem, formElem) ->
[controlId, resolvedControl] =
if _.isString(controlIdOrElem)
controlId = controlIdOrElem
formId =
if _.isElement(formElem)
formElem.id
else
object ScalaJSExample extends js.JSApp {
implicit class OptionOption[U](oo: Option[Option[U]]) {
def flattenMe: Option[U] = oo flatMap identity
}
def main() =
println(Some(Some(42)).flattenMe)
}
@ebruchez
ebruchez / format.xq
Last active August 29, 2015 14:25
Example of indentation of a pretty large XPath 2 expression
for $raw in . return
for $query in instance('fr-search-instance')/query[$detail-position + 1] return
for $control in $query/@control return
if ($control = 'textarea') then
if (string-length($raw) > 20) then
concat(substring($raw, 1, 20), '...')
else
$raw
else if (frf:isMultipleSelectionControl($control)) then
string-join(
val fastOptJSCombine = taskKey[File]("Combine -fastopt.js with -launcher.js.")
fastOptJSCombine := {
val fastOptFile = (fastOptJS in Compile).value.data
val outputDir = fastOptFile.getParentFile
val prefix = name.value.toLowerCase + "-"
val combinedFile = outputDir / (prefix + "combined.js")
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:saxon="http://saxon.sf.net/"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sql="http://orbeon.org/oxf/xml/sql"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:saxon="http://saxon.sf.net/"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sql="http://orbeon.org/oxf/xml/sql"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
<xf:model xmlns:xf="http://www.w3.org/2002/xforms">
<xf:action
event="xforms-focus"
target="fr-form-group"
observer="fr-form-group"
defaultAction="cancel"/>
</xf:model>

Keybase proof

I hereby claim:

  • I am ebruchez on github.
  • I am ebruchez (https://keybase.io/ebruchez) on keybase.
  • I have a public key whose fingerprint is BF13 BC5B 3FC2 BB3F AD52 60B1 A817 05F4 968A 6E4D

To claim this, I am signing this object: