Skip to content

Instantly share code, notes, and snippets.

View myoung34's full-sized avatar

myoung34 myoung34

View GitHub Profile
@myoung34
myoung34 / bacon-ipsum-ml-docs.xqy
Created September 25, 2012 23:35
Set up the bacon ipsum documents
declare function local:random-hex-set( $length as xs:integer ) {
fn:string-join(
for $i in 1 to $length return
xs:string(
xdmp:integer-to-hex(
xdmp:random(15)
)
)
,""
)
@myoung34
myoung34 / gist:3785133
Created September 25, 2012 23:44
Search for documents, add/remove from collections
let $docs :=
fn:distinct-values(
for $i in cts:search(//beef,cts:word-query("tip"))
return fn:base-uri($i)
)
return
for $i in $docs return
xdmp:document-add-collections(
$i,
'/marc/favorites'
@myoung34
myoung34 / gist:3785143
Created September 25, 2012 23:46
Collections the correct way - no collections
let $docs :=
fn:distinct-values(
for $i in cts:search(//beef,cts:word-query("tip")) return
fn:base-uri($i)
)
let $favorites :=
<favorites>{
for $i in $docs return
<doc>{$i}</doc>
@myoung34
myoung34 / gist:3785147
Created September 25, 2012 23:48
Execute the denormalized document
cts:search(/,
cts:document-query(
fn:doc('/marc/favorites')/favorites//doc/text()
)
)
@myoung34
myoung34 / gtablet.cfg-diff
Created November 27, 2012 04:30
GTablet NVFlash fix
diff --git a/gtablet.cfg b/gtablet.cfg
index cdc5684..375eda4 100644
--- a/gtablet.cfg
+++ b/gtablet.cfg
@@ -60,12 +60,12 @@ id=6
type=data
allocation_policy=sequential
filesystem_type=basic
-size=4194304
+size=16777216
@myoung34
myoung34 / gtablet.cfg
Created November 27, 2012 04:32
GTablet NVFlash fixed file
[device]
type=nand
instance=0
[partition]
name=BCT
id=2
type=boot_config_table
allocation_policy=sequential
filesystem_type=basic
pi@raspberrypi ~ $ sudo apt-get install bluez pulseaudio-module-bluetooth python-gobject python-gobject-2
pi@raspberrypi ~ $ sudo usermod -a -G lp pi
pi@raspberrypi ~ $ sudo nano /etc/bluetooth/audio.conf
pi@raspberrypi ~ $ sudo nano /etc/pulse/daemon.conf
pi@raspberrypi ~ $ sudo apt-get install bluez-tools qdbus git-core